mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-05 22:42:25 +08:00
6a454ec624
Removed unused ContactUserStore.exportingCsv and ContactUserStore.exportingVcf
62 lines
1.6 KiB
JavaScript
62 lines
1.6 KiB
JavaScript
import ko from 'ko';
|
|
import { KeyState } from 'Common/Enums';
|
|
import { Focused } from 'Common/EnumsUser';
|
|
import { keyScope, leftPanelDisabled, Settings, SettingsGet } from 'Common/Globals';
|
|
import { ThemeStore } from 'Stores/Theme';
|
|
|
|
export const AppUserStore = {
|
|
attachmentsActions: ko.observableArray(),
|
|
|
|
devEmail: '',
|
|
devPassword: '',
|
|
|
|
populate: () => {
|
|
AppUserStore.projectHash(SettingsGet('ProjectHash'));
|
|
|
|
AppUserStore.contactsAutosave(!!SettingsGet('ContactsAutosave'));
|
|
AppUserStore.useLocalProxyForExternalImages(!!SettingsGet('UseLocalProxyForExternalImages'));
|
|
|
|
AppUserStore.contactsIsAllowed(!!SettingsGet('ContactsIsAllowed'));
|
|
|
|
const attachmentsActions = Settings.app('attachmentsActions');
|
|
AppUserStore.attachmentsActions(Array.isNotEmpty(attachmentsActions) ? attachmentsActions : []);
|
|
|
|
AppUserStore.devEmail = SettingsGet('DevEmail');
|
|
AppUserStore.devPassword = SettingsGet('DevPassword');
|
|
}
|
|
};
|
|
|
|
ko.addObservablesTo(AppUserStore, {
|
|
currentAudio: '',
|
|
|
|
focusedState: Focused.None,
|
|
|
|
projectHash: '',
|
|
threadsAllowed: false,
|
|
|
|
composeInEdit: false,
|
|
|
|
contactsAutosave: false,
|
|
useLocalProxyForExternalImages: false,
|
|
|
|
contactsIsAllowed: false
|
|
});
|
|
|
|
AppUserStore.focusedState.subscribe(value => {
|
|
switch (value) {
|
|
case Focused.MessageList:
|
|
keyScope(KeyState.MessageList);
|
|
ThemeStore.isMobile() && leftPanelDisabled(true);
|
|
break;
|
|
case Focused.MessageView:
|
|
keyScope(KeyState.MessageView);
|
|
ThemeStore.isMobile() && leftPanelDisabled(true);
|
|
break;
|
|
case Focused.FolderList:
|
|
keyScope(KeyState.FolderList);
|
|
ThemeStore.isMobile() && leftPanelDisabled(false);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
});
|