mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-01 04:22:15 +08:00
Simplify AppUserStore.contactsIsAllowed
This commit is contained in:
parent
8157692a29
commit
676de1ed23
6 changed files with 6 additions and 12 deletions
|
@ -47,7 +47,6 @@ import {
|
|||
|
||||
import { getNotification, i18n } from 'Common/Translator';
|
||||
|
||||
import { AppUserStore } from 'Stores/User/App';
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
import { NotificationUserStore } from 'Stores/User/Notification';
|
||||
import { AccountUserStore } from 'Stores/User/Account';
|
||||
|
@ -887,7 +886,6 @@ class AppUser extends AbstractApp {
|
|||
|
||||
addEventListener('resize', () => leftPanelDisabled(ThemeStore.isMobile() || 1000 > innerWidth));
|
||||
|
||||
AppUserStore.populate();
|
||||
SettingsUserStore.populate();
|
||||
NotificationUserStore.populate();
|
||||
AccountUserStore.populate();
|
||||
|
|
|
@ -45,7 +45,7 @@ export class SettingsUserScreen extends AbstractSettingsScreen {
|
|||
|
||||
settingsAddViewModel(GeneralUserSettings, 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||
|
||||
if (AppUserStore.contactsIsAllowed()) {
|
||||
if (AppUserStore.allowContacts()) {
|
||||
settingsAddViewModel(ContactsUserSettings, 'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@ import { addObservablesTo } from 'Common/Utils';
|
|||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
||||
export const AppUserStore = {
|
||||
populate: () => {
|
||||
AppUserStore.contactsIsAllowed(!!SettingsGet('ContactsIsAllowed'));
|
||||
}
|
||||
allowContacts: () => !!SettingsGet('ContactsIsAllowed')
|
||||
};
|
||||
|
||||
addObservablesTo(AppUserStore, {
|
||||
|
@ -16,9 +14,7 @@ addObservablesTo(AppUserStore, {
|
|||
|
||||
threadsAllowed: false,
|
||||
|
||||
composeInEdit: false,
|
||||
|
||||
contactsIsAllowed: false
|
||||
composeInEdit: false
|
||||
});
|
||||
|
||||
AppUserStore.focusedState.subscribe(value => {
|
||||
|
|
|
@ -125,7 +125,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
this.sLastFocusedField = 'to';
|
||||
|
||||
this.allowContacts = AppUserStore.contactsIsAllowed();
|
||||
this.allowContacts = AppUserStore.allowContacts();
|
||||
|
||||
this.bSkipNextHide = false;
|
||||
this.editorDefaultType = SettingsUserStore.editorDefaultType;
|
||||
|
|
|
@ -36,7 +36,7 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
|
|||
capaAdditionalAccounts: Settings.capa(Capa.AdditionalAccounts)
|
||||
});
|
||||
|
||||
this.allowContacts = AppUserStore.contactsIsAllowed();
|
||||
this.allowContacts = AppUserStore.allowContacts();
|
||||
|
||||
this.addAccountClick = this.addAccountClick.bind(this);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ export class FolderListMailBoxUserView extends AbstractViewLeft {
|
|||
this.leftPanelDisabled = leftPanelDisabled;
|
||||
|
||||
this.allowComposer = Settings.capa(Capa.Composer);
|
||||
this.allowContacts = AppUserStore.contactsIsAllowed();
|
||||
this.allowContacts = AppUserStore.allowContacts();
|
||||
|
||||
this.folderListFocused = ko.computed(() => Scope.FolderList === AppUserStore.focusedState());
|
||||
|
||||
|
|
Loading…
Reference in a new issue