mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Convert user stores to single object instances
Removed unused ContactUserStore.exportingCsv and ContactUserStore.exportingVcf
This commit is contained in:
parent
914c6e8d14
commit
6a454ec624
46 changed files with 671 additions and 710 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import PgpStore from 'Stores/User/Pgp';
|
||||
import { PgpUserStore } from 'Stores/User/Pgp';
|
||||
|
||||
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
|
@ -26,7 +26,7 @@ class AddOpenPgpKeyPopupView extends AbstractViewPopup {
|
|||
addOpenPgpKeyCommand() {
|
||||
// eslint-disable-next-line max-len
|
||||
const reg = /[-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[-]{3,6}[\s\S]+?[-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[-]{3,6}/gi,
|
||||
openpgpKeyring = PgpStore.openpgpKeyring;
|
||||
openpgpKeyring = PgpUserStore.openpgpKeyring;
|
||||
|
||||
let keyTrimmed = this.key().trim();
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import ko from 'ko';
|
|||
|
||||
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
||||
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
import { MessageUserStore } from 'Stores/User/Message';
|
||||
|
||||
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
|
@ -47,7 +47,7 @@ class AdvancedSearchPopupView extends AbstractViewPopup {
|
|||
searchCommand() {
|
||||
const search = this.buildSearchString();
|
||||
if (search) {
|
||||
MessageStore.mainMessageListSearch(search);
|
||||
MessageUserStore.mainMessageListSearch(search);
|
||||
}
|
||||
|
||||
this.cancelCommand();
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@ import { timestampToString } from 'Common/Momentor';
|
|||
import { MessageFlagsCache, setFolderHash } from 'Common/Cache';
|
||||
import { Settings, SettingsGet } from 'Common/Globals';
|
||||
|
||||
import AppStore from 'Stores/User/App';
|
||||
import SettingsStore from 'Stores/User/Settings';
|
||||
import { AppUserStore } from 'Stores/User/App';
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
import { IdentityUserStore } from 'Stores/User/Identity';
|
||||
import AccountStore from 'Stores/User/Account';
|
||||
import FolderStore from 'Stores/User/Folder';
|
||||
import PgpStore from 'Stores/User/Pgp';
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
import { AccountUserStore } from 'Stores/User/Account';
|
||||
import { FolderUserStore } from 'Stores/User/Folder';
|
||||
import { PgpUserStore } from 'Stores/User/Pgp';
|
||||
import { MessageUserStore } from 'Stores/User/Message';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
|
|
@ -126,13 +126,13 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
this.sLastFocusedField = 'to';
|
||||
|
||||
this.allowContacts = !!AppStore.contactsIsAllowed();
|
||||
this.allowContacts = !!AppUserStore.contactsIsAllowed();
|
||||
|
||||
this.bSkipNextHide = false;
|
||||
this.composeInEdit = AppStore.composeInEdit;
|
||||
this.editorDefaultType = SettingsStore.editorDefaultType;
|
||||
this.composeInEdit = AppUserStore.composeInEdit;
|
||||
this.editorDefaultType = SettingsUserStore.editorDefaultType;
|
||||
|
||||
this.capaOpenPGP = PgpStore.capaOpenPGP;
|
||||
this.capaOpenPGP = PgpUserStore.capaOpenPGP;
|
||||
|
||||
this.identities = IdentityUserStore;
|
||||
|
||||
|
|
@ -319,8 +319,8 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
setInterval(() => {
|
||||
if (
|
||||
this.modalVisibility() &&
|
||||
!FolderStore.draftFolderNotEnabled() &&
|
||||
SettingsStore.allowDraftAutosave() &&
|
||||
!FolderUserStore.draftFolderNotEnabled() &&
|
||||
SettingsUserStore.allowDraftAutosave() &&
|
||||
!this.isEmptyForm(false) &&
|
||||
!this.saving() &&
|
||||
!this.sending() &&
|
||||
|
|
@ -365,7 +365,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
sendCommand() {
|
||||
let sSentFolder = FolderStore.sentFolder();
|
||||
let sSentFolder = FolderUserStore.sentFolder();
|
||||
|
||||
this.attachmentsInProcessError(false);
|
||||
this.attachmentsInErrorError(false);
|
||||
|
|
@ -384,7 +384,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
if (!this.emptyToError() && !this.attachmentsInErrorError() && !this.attachmentsInProcessError()) {
|
||||
if (SettingsStore.replySameFolder()) {
|
||||
if (SettingsUserStore.replySameFolder()) {
|
||||
if (
|
||||
isArray(this.aDraftInfo) &&
|
||||
3 === this.aDraftInfo.length &&
|
||||
|
|
@ -430,7 +430,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
saveCommand() {
|
||||
if (FolderStore.draftFolderNotEnabled()) {
|
||||
if (FolderUserStore.draftFolderNotEnabled()) {
|
||||
showScreenPopup(FolderSystemPopupView, [SetSystemFoldersNotification.Draft]);
|
||||
} else {
|
||||
this.savedError(false);
|
||||
|
|
@ -438,11 +438,11 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
this.autosaveStart();
|
||||
|
||||
setFolderHash(FolderStore.draftFolder(), '');
|
||||
setFolderHash(FolderUserStore.draftFolder(), '');
|
||||
|
||||
Remote.saveMessage(
|
||||
this.saveMessageResponse.bind(this),
|
||||
this.getMessageRequestParams(FolderStore.draftFolder())
|
||||
this.getMessageRequestParams(FolderUserStore.draftFolder())
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -470,8 +470,8 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
this.modalVisibility() &&
|
||||
!this.saving() &&
|
||||
!this.sending() &&
|
||||
!FolderStore.draftFolderNotEnabled() &&
|
||||
SettingsStore.allowDraftAutosave()
|
||||
!FolderUserStore.draftFolderNotEnabled() &&
|
||||
SettingsUserStore.allowDraftAutosave()
|
||||
) {
|
||||
this.saveCommand();
|
||||
}
|
||||
|
|
@ -491,8 +491,8 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
autosaveFunction() {
|
||||
if (
|
||||
this.modalVisibility() &&
|
||||
!FolderStore.draftFolderNotEnabled() &&
|
||||
SettingsStore.allowDraftAutosave() &&
|
||||
!FolderUserStore.draftFolderNotEnabled() &&
|
||||
SettingsUserStore.allowDraftAutosave() &&
|
||||
!this.isEmptyForm(false) &&
|
||||
!this.saving() &&
|
||||
!this.sending() &&
|
||||
|
|
@ -518,7 +518,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
openOpenPgpPopup() {
|
||||
if (PgpStore.capaOpenPGP() && this.oEditor && !this.oEditor.isHtml()) {
|
||||
if (PgpUserStore.capaOpenPGP() && this.oEditor && !this.oEditor.isHtml()) {
|
||||
showScreenPopup(ComposeOpenPgpPopupView, [
|
||||
result => this.editor(editor => editor.setPlain(result)),
|
||||
this.oEditor.getData(false),
|
||||
|
|
@ -531,10 +531,10 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
reloadDraftFolder() {
|
||||
const draftFolder = FolderStore.draftFolder();
|
||||
const draftFolder = FolderUserStore.draftFolder();
|
||||
if (draftFolder && UNUSED_OPTION_VALUE !== draftFolder) {
|
||||
setFolderHash(draftFolder, '');
|
||||
if (FolderStore.currentFolderFullNameRaw() === draftFolder) {
|
||||
if (FolderUserStore.currentFolderFullNameRaw() === draftFolder) {
|
||||
rl.app.reloadMessageList(true);
|
||||
} else {
|
||||
rl.app.folderInformation(draftFolder);
|
||||
|
|
@ -627,9 +627,9 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
result = true;
|
||||
|
||||
if (this.bFromDraft) {
|
||||
const message = MessageStore.message();
|
||||
const message = MessageUserStore.message();
|
||||
if (message && this.draftFolder() === message.folder && this.draftUid() === message.uid) {
|
||||
MessageStore.message(null);
|
||||
MessageUserStore.message(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -656,7 +656,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
this.autosaveStop();
|
||||
|
||||
if (!this.bSkipNextHide) {
|
||||
AppStore.composeInEdit(false);
|
||||
AppUserStore.composeInEdit(false);
|
||||
this.reset();
|
||||
}
|
||||
|
||||
|
|
@ -738,7 +738,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
this.autosaveStart();
|
||||
|
||||
if (AppStore.composeInEdit()) {
|
||||
if (AppUserStore.composeInEdit()) {
|
||||
type = type || ComposeType.Empty;
|
||||
if (ComposeType.Empty !== type) {
|
||||
showScreenPopup(AskPopupView, [
|
||||
|
|
@ -811,7 +811,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
* @param {string=} sCustomPlainText = null
|
||||
*/
|
||||
initOnShow(sType, oMessageOrArray, aToEmails, aCcEmails, aBccEmails, sCustomSubject, sCustomPlainText) {
|
||||
AppStore.composeInEdit(true);
|
||||
AppUserStore.composeInEdit(true);
|
||||
|
||||
let sFrom = '',
|
||||
sTo = '',
|
||||
|
|
@ -825,7 +825,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
message = null;
|
||||
|
||||
const excludeEmail = {},
|
||||
mEmail = AccountStore.email(),
|
||||
mEmail = AccountUserStore.email(),
|
||||
lineComposeType = sType || ComposeType.Empty;
|
||||
|
||||
oMessageOrArray = oMessageOrArray || null;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { pString, defaultOptionsAfterRender } from 'Common/Utils';
|
|||
import { KeyState } from 'Common/Enums';
|
||||
import { i18n } from 'Common/Translator';
|
||||
|
||||
import PgpStore from 'Stores/User/Pgp';
|
||||
import { PgpUserStore } from 'Stores/User/Pgp';
|
||||
|
||||
import { EmailModel } from 'Model/Email';
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
encryptKeysView: () => this.encryptKeys.map(oKey => (oKey ? oKey.key : null)).filter(v => v),
|
||||
|
||||
privateKeysOptions: () => {
|
||||
const opts = PgpStore.openpgpkeysPrivate().map(oKey => {
|
||||
const opts = PgpUserStore.openpgpkeysPrivate().map(oKey => {
|
||||
if (this.signKey() && this.signKey().key.id === oKey.id) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
},
|
||||
|
||||
publicKeysOptions: () => {
|
||||
const opts = PgpStore.openpgpkeysPublic().map(oKey => {
|
||||
const opts = PgpUserStore.openpgpkeysPublic().map(oKey => {
|
||||
if (this.encryptKeysView().includes(oKey)) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -176,19 +176,19 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
try {
|
||||
if (aPublicKeys.length) {
|
||||
if (privateKey) {
|
||||
pgpPromise = PgpStore.openpgp.encrypt({
|
||||
pgpPromise = PgpUserStore.openpgp.encrypt({
|
||||
data: this.text(),
|
||||
publicKeys: aPublicKeys,
|
||||
privateKeys: [privateKey]
|
||||
});
|
||||
} else {
|
||||
pgpPromise = PgpStore.openpgp.encrypt({
|
||||
pgpPromise = PgpUserStore.openpgp.encrypt({
|
||||
data: this.text(),
|
||||
publicKeys: aPublicKeys
|
||||
});
|
||||
}
|
||||
} else if (privateKey) {
|
||||
pgpPromise = PgpStore.openpgp.sign({
|
||||
pgpPromise = PgpUserStore.openpgp.sign({
|
||||
data: this.text(),
|
||||
privateKeys: [privateKey]
|
||||
});
|
||||
|
|
@ -342,7 +342,7 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
emailLine = identity.email();
|
||||
rec.unshift(emailLine);
|
||||
|
||||
const keys = PgpStore.findAllPrivateKeysByEmailNotNative(emailLine);
|
||||
const keys = PgpUserStore.findAllPrivateKeysByEmailNotNative(emailLine);
|
||||
if (keys && keys[0]) {
|
||||
this.signKey({
|
||||
'users': keys[0].users || [emailLine],
|
||||
|
|
@ -359,7 +359,7 @@ class ComposeOpenPgpPopupView extends AbstractViewPopup {
|
|||
if (rec.length) {
|
||||
this.encryptKeys(
|
||||
rec.map(recEmail => {
|
||||
const keys = PgpStore.findAllPublicKeysByEmailNotNative(recEmail);
|
||||
const keys = PgpUserStore.findAllPublicKeysByEmailNotNative(recEmail);
|
||||
return keys
|
||||
? keys.map(publicKey => ({
|
||||
'empty': !publicKey,
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ import { Selector } from 'Common/Selector';
|
|||
import { serverRequestRaw, serverRequest } from 'Common/Links';
|
||||
import { i18n, getNotification } from 'Common/Translator';
|
||||
|
||||
import SettingsStore from 'Stores/User/Settings';
|
||||
import ContactStore from 'Stores/User/Contact';
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
import { ContactUserStore } from 'Stores/User/Contact';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
|
|
@ -39,8 +39,8 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
this.bBackToCompose = false;
|
||||
this.sLastComposeFocusedField = '';
|
||||
|
||||
this.allowContactsSync = ContactStore.allowContactsSync;
|
||||
this.enableContactsSync = ContactStore.enableContactsSync;
|
||||
this.allowContactsSync = ContactUserStore.allowSync;
|
||||
this.enableContactsSync = ContactUserStore.enableSync;
|
||||
|
||||
this.addObservables({
|
||||
search: '',
|
||||
|
|
@ -66,14 +66,14 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
watchHash: false
|
||||
});
|
||||
|
||||
this.contacts = ContactStore.contacts;
|
||||
this.contacts = ContactUserStore;
|
||||
|
||||
this.viewProperties = ko.observableArray();
|
||||
|
||||
this.useCheckboxesInList = SettingsStore.useCheckboxesInList;
|
||||
this.useCheckboxesInList = SettingsUserStore.useCheckboxesInList;
|
||||
|
||||
this.selector = new Selector(
|
||||
this.contacts,
|
||||
ContactUserStore,
|
||||
this.currentContact,
|
||||
null,
|
||||
'.e-contact-item .actionHandle',
|
||||
|
|
@ -119,7 +119,7 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
contactHasValidName: () => !!this.viewProperties.find(prop => propertyIsName(prop) && prop.isValid()),
|
||||
|
||||
contactsCheckedOrSelected: () => {
|
||||
const checked = this.contacts.filter(item => item.checked && item.checked()),
|
||||
const checked = ContactUserStore.filter(item => item.checked && item.checked()),
|
||||
selected = this.currentContact();
|
||||
|
||||
return selected
|
||||
|
|
@ -347,9 +347,9 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
|
||||
if (j) {
|
||||
j.on('onStart', () => {
|
||||
this.contacts.importing(true);
|
||||
ContactUserStore.importing(true);
|
||||
}).on('onComplete', (id, result, data) => {
|
||||
this.contacts.importing(false);
|
||||
ContactUserStore.importing(false);
|
||||
this.reloadContactList();
|
||||
if (!id || !result || !data || !data.Result) {
|
||||
alert(i18n('CONTACTS/ERROR_IMPORT_FILE'));
|
||||
|
|
@ -360,11 +360,10 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
removeCheckedOrSelectedContactsFromList() {
|
||||
const koContacts = this.contacts,
|
||||
contacts = this.contactsCheckedOrSelected();
|
||||
const contacts = this.contactsCheckedOrSelected();
|
||||
|
||||
let currentContact = this.currentContact(),
|
||||
count = this.contacts.length;
|
||||
count = ContactUserStore.length;
|
||||
|
||||
if (contacts.length) {
|
||||
contacts.forEach(contact => {
|
||||
|
|
@ -383,7 +382,7 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
|
||||
setTimeout(() => {
|
||||
contacts.forEach(contact => {
|
||||
koContacts.remove(contact);
|
||||
ContactUserStore.remove(contact);
|
||||
delegateRunOnDestroy(contact);
|
||||
});
|
||||
}, 500);
|
||||
|
|
@ -459,7 +458,7 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
offset = 0;
|
||||
}
|
||||
|
||||
this.contacts.loading(true);
|
||||
ContactUserStore.loading(true);
|
||||
Remote.contacts(
|
||||
(result, data) => {
|
||||
let count = 0,
|
||||
|
|
@ -479,10 +478,10 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
|
||||
this.contactsCount(count);
|
||||
|
||||
delegateRunOnDestroy(this.contacts());
|
||||
this.contacts(list);
|
||||
delegateRunOnDestroy(ContactUserStore());
|
||||
ContactUserStore(list);
|
||||
|
||||
this.contacts.loading(false);
|
||||
ContactUserStore.loading(false);
|
||||
this.viewClearSearch(!!this.search());
|
||||
},
|
||||
offset,
|
||||
|
|
@ -533,8 +532,8 @@ class ContactsPopupView extends AbstractViewPopup {
|
|||
this.search('');
|
||||
this.contactsCount(0);
|
||||
|
||||
delegateRunOnDestroy(this.contacts());
|
||||
this.contacts([]);
|
||||
delegateRunOnDestroy(ContactUserStore());
|
||||
ContactUserStore([]);
|
||||
|
||||
this.sLastComposeFocusedField = '';
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { FilterConditionField, FilterConditionType } from 'Model/FilterCondition
|
|||
import { defaultOptionsAfterRender } from 'Common/Utils';
|
||||
import { i18n, initOnStartOrLangChange } from 'Common/Translator';
|
||||
|
||||
import FolderStore from 'Stores/User/Folder';
|
||||
import { FolderUserStore } from 'Stores/User/Folder';
|
||||
import { SieveUserStore } from 'Stores/User/Sieve';
|
||||
|
||||
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||
|
|
@ -25,7 +25,7 @@ class FilterPopupView extends AbstractViewPopup {
|
|||
this.fTrueCallback = null;
|
||||
|
||||
this.defaultOptionsAfterRender = defaultOptionsAfterRender;
|
||||
this.folderSelectList = FolderStore.folderMenuForFilters;
|
||||
this.folderSelectList = FolderUserStore.folderMenuForFilters;
|
||||
|
||||
this.selectedFolderValue.subscribe(() => this.filter() && this.filter().actionValueError(false));
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { StorageResultType, Notification } from 'Common/Enums';
|
|||
import { i18n, getNotification } from 'Common/Translator';
|
||||
import { setFolderHash } from 'Common/Cache';
|
||||
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
import { MessageUserStore } from 'Stores/User/Message';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
|
|
@ -44,8 +44,8 @@ class FolderClearPopupView extends AbstractViewPopup {
|
|||
clearCommand() {
|
||||
const folderToClear = this.selectedFolder();
|
||||
if (folderToClear) {
|
||||
MessageStore.message(null);
|
||||
MessageStore.messageList([]);
|
||||
MessageUserStore.message(null);
|
||||
MessageUserStore.messageList([]);
|
||||
|
||||
this.clearingProcess(true);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
|||
import { defaultOptionsAfterRender } from 'Common/Utils';
|
||||
import { folderListOptionsBuilder } from 'Common/UtilsUser';
|
||||
|
||||
import FolderStore from 'Stores/User/Folder';
|
||||
import { FolderUserStore } from 'Stores/User/Folder';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
|
|
@ -25,17 +25,15 @@ class FolderCreatePopupView extends AbstractViewPopup {
|
|||
|
||||
this.parentFolderSelectList = ko.computed(() => {
|
||||
const top = [],
|
||||
list = FolderStore.folderList(),
|
||||
fRenameCallback = (oItem) =>
|
||||
list = FolderUserStore.folderList(),
|
||||
fDisableCallback = FolderUserStore.namespace
|
||||
? item => FolderUserStore.namespace !== item.fullNameRaw.substr(0, FolderUserStore.namespace.length)
|
||||
: null,
|
||||
fRenameCallback = oItem =>
|
||||
oItem ? (oItem.isSystemFolder() ? oItem.name() + ' ' + oItem.manageFolderSystemName() : oItem.name()) : '';
|
||||
|
||||
top.push(['', '']);
|
||||
|
||||
let fDisableCallback = null;
|
||||
if (FolderStore.namespace) {
|
||||
fDisableCallback = (item) => FolderStore.namespace !== item.fullNameRaw.substr(0, FolderStore.namespace.length);
|
||||
}
|
||||
|
||||
return folderListOptionsBuilder([], list, [], top, null, fDisableCallback, null, fRenameCallback);
|
||||
});
|
||||
|
||||
|
|
@ -48,8 +46,8 @@ class FolderCreatePopupView extends AbstractViewPopup {
|
|||
|
||||
createFolderCommand() {
|
||||
let parentFolderName = this.selectedParentValue();
|
||||
if (!parentFolderName && 1 < FolderStore.namespace.length) {
|
||||
parentFolderName = FolderStore.namespace.substr(0, FolderStore.namespace.length - 1);
|
||||
if (!parentFolderName && 1 < FolderUserStore.namespace.length) {
|
||||
parentFolderName = FolderUserStore.namespace.substr(0, FolderUserStore.namespace.length - 1);
|
||||
}
|
||||
|
||||
rl.app.foldersPromisesActionHelper(
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { defaultOptionsAfterRender } from 'Common/Utils';
|
|||
import { folderListOptionsBuilder } from 'Common/UtilsUser';
|
||||
import { initOnStartOrLangChange, i18n } from 'Common/Translator';
|
||||
|
||||
import FolderStore from 'Stores/User/Folder';
|
||||
import { FolderUserStore } from 'Stores/User/Folder';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
|
|
@ -30,8 +30,8 @@ class FolderSystemPopupView extends AbstractViewPopup {
|
|||
this.folderSelectList = ko.computed(() =>
|
||||
folderListOptionsBuilder(
|
||||
[],
|
||||
FolderStore.folderList(),
|
||||
FolderStore.folderListSystemNames(),
|
||||
FolderUserStore.folderList(),
|
||||
FolderUserStore.folderListSystemNames(),
|
||||
[
|
||||
['', this.sChooseOnText],
|
||||
[UNUSED_OPTION_VALUE, this.sUnuseText]
|
||||
|
|
@ -45,28 +45,28 @@ class FolderSystemPopupView extends AbstractViewPopup {
|
|||
)
|
||||
);
|
||||
|
||||
this.sentFolder = FolderStore.sentFolder;
|
||||
this.draftFolder = FolderStore.draftFolder;
|
||||
this.spamFolder = FolderStore.spamFolder;
|
||||
this.trashFolder = FolderStore.trashFolder;
|
||||
this.archiveFolder = FolderStore.archiveFolder;
|
||||
this.sentFolder = FolderUserStore.sentFolder;
|
||||
this.draftFolder = FolderUserStore.draftFolder;
|
||||
this.spamFolder = FolderUserStore.spamFolder;
|
||||
this.trashFolder = FolderUserStore.trashFolder;
|
||||
this.archiveFolder = FolderUserStore.archiveFolder;
|
||||
|
||||
const settingsSet = Settings.set,
|
||||
fSetSystemFolders = () => {
|
||||
settingsSet('SentFolder', FolderStore.sentFolder());
|
||||
settingsSet('DraftFolder', FolderStore.draftFolder());
|
||||
settingsSet('SpamFolder', FolderStore.spamFolder());
|
||||
settingsSet('TrashFolder', FolderStore.trashFolder());
|
||||
settingsSet('ArchiveFolder', FolderStore.archiveFolder());
|
||||
settingsSet('SentFolder', FolderUserStore.sentFolder());
|
||||
settingsSet('DraftFolder', FolderUserStore.draftFolder());
|
||||
settingsSet('SpamFolder', FolderUserStore.spamFolder());
|
||||
settingsSet('TrashFolder', FolderUserStore.trashFolder());
|
||||
settingsSet('ArchiveFolder', FolderUserStore.archiveFolder());
|
||||
},
|
||||
fSaveSystemFolders = (()=>{
|
||||
fSetSystemFolders();
|
||||
Remote.saveSystemFolders(()=>{}, {
|
||||
SentFolder: FolderStore.sentFolder(),
|
||||
DraftFolder: FolderStore.draftFolder(),
|
||||
SpamFolder: FolderStore.spamFolder(),
|
||||
TrashFolder: FolderStore.trashFolder(),
|
||||
ArchiveFolder: FolderStore.archiveFolder(),
|
||||
SentFolder: FolderUserStore.sentFolder(),
|
||||
DraftFolder: FolderUserStore.draftFolder(),
|
||||
SpamFolder: FolderUserStore.spamFolder(),
|
||||
TrashFolder: FolderUserStore.trashFolder(),
|
||||
ArchiveFolder: FolderUserStore.archiveFolder(),
|
||||
NullFolder: 'NullFolder'
|
||||
});
|
||||
}).debounce(1000),
|
||||
|
|
@ -75,7 +75,7 @@ class FolderSystemPopupView extends AbstractViewPopup {
|
|||
fSaveSystemFolders();
|
||||
};
|
||||
|
||||
ko.addSubscribablesTo(FolderStore, {
|
||||
ko.addSubscribablesTo(FolderUserStore, {
|
||||
sentFolder: fCallback,
|
||||
draftFolder: fCallback,
|
||||
spamFolder: fCallback,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { pInt } from 'Common/Utils';
|
||||
|
||||
import PgpStore from 'Stores/User/Pgp';
|
||||
import { PgpUserStore } from 'Stores/User/Pgp';
|
||||
|
||||
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
|
@ -31,7 +31,7 @@ class NewOpenPgpKeyPopupView extends AbstractViewPopup {
|
|||
|
||||
generateOpenPgpKeyCommand() {
|
||||
const userId = {},
|
||||
openpgpKeyring = PgpStore.openpgpKeyring;
|
||||
openpgpKeyring = PgpUserStore.openpgpKeyring;
|
||||
|
||||
this.emailError(!this.email().trim());
|
||||
if (!openpgpKeyring || this.emailError()) {
|
||||
|
|
@ -48,7 +48,7 @@ class NewOpenPgpKeyPopupView extends AbstractViewPopup {
|
|||
|
||||
setTimeout(() => {
|
||||
try {
|
||||
PgpStore.openpgp
|
||||
PgpUserStore.openpgp
|
||||
.generateKey({
|
||||
userIds: [userId],
|
||||
numBits: pInt(this.keyBitLength()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue