Move to plugin #385

This commit is contained in:
the-djmaze 2022-05-18 17:15:31 +02:00
parent 86ac71ea2e
commit 9789a2509f
13 changed files with 197 additions and 67 deletions

View file

@ -92,6 +92,8 @@ export class AppUser extends AbstractApp {
addShortcut('escape,enter', '', dropdownsDetectVisibility);
addEventListener('click', dropdownsDetectVisibility);
this.folderList = FolderUserStore.folderList;
}
refresh() {

View file

@ -4,7 +4,6 @@ import { koComputable } from 'External/ko';
import { SettingsGet } from 'Common/Globals';
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
import { ContactUserStore } from 'Stores/User/Contact';
import { FolderUserStore } from 'Stores/User/Folder';
import Remote from 'Remote/User/Fetch';
export class UserSettingsContacts /*extends AbstractViewSettings*/ {
@ -49,33 +48,5 @@ export class UserSettingsContacts /*extends AbstractViewSettings*/ {
Password: ContactUserStore.syncPass()
})
);
this.kolabContactFolder = ko.observable(SettingsGet('KolabContactFolder'));
this.kolabContactFolder.subscribe(value =>
Remote.saveSettings(null, { KolabContactFolder: value })
);
this.showKolab = FolderUserStore.allowKolab();
this.folderSelectList = koComputable(() => {
const
aResult = [{
id: '',
name: '',
}],
foldersWalk = folders => {
folders.forEach(oItem => {
if ('contact' === oItem.kolabType()) {
aResult.push({
id: oItem.fullName,
name: oItem.fullName
});
}
if (oItem.subFolders.length) {
foldersWalk(oItem.subFolders());
}
});
};
foldersWalk(FolderUserStore.folderList());
return aResult;
});
}
}