mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03: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 { getNotification, i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import { AppUserStore } from 'Stores/User/App';
|
|
||||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||||
import { NotificationUserStore } from 'Stores/User/Notification';
|
import { NotificationUserStore } from 'Stores/User/Notification';
|
||||||
import { AccountUserStore } from 'Stores/User/Account';
|
import { AccountUserStore } from 'Stores/User/Account';
|
||||||
|
|
@ -887,7 +886,6 @@ class AppUser extends AbstractApp {
|
||||||
|
|
||||||
addEventListener('resize', () => leftPanelDisabled(ThemeStore.isMobile() || 1000 > innerWidth));
|
addEventListener('resize', () => leftPanelDisabled(ThemeStore.isMobile() || 1000 > innerWidth));
|
||||||
|
|
||||||
AppUserStore.populate();
|
|
||||||
SettingsUserStore.populate();
|
SettingsUserStore.populate();
|
||||||
NotificationUserStore.populate();
|
NotificationUserStore.populate();
|
||||||
AccountUserStore.populate();
|
AccountUserStore.populate();
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ export class SettingsUserScreen extends AbstractSettingsScreen {
|
||||||
|
|
||||||
settingsAddViewModel(GeneralUserSettings, 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
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');
|
settingsAddViewModel(ContactsUserSettings, 'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@ import { addObservablesTo } from 'Common/Utils';
|
||||||
import { ThemeStore } from 'Stores/Theme';
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
export const AppUserStore = {
|
export const AppUserStore = {
|
||||||
populate: () => {
|
allowContacts: () => !!SettingsGet('ContactsIsAllowed')
|
||||||
AppUserStore.contactsIsAllowed(!!SettingsGet('ContactsIsAllowed'));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
addObservablesTo(AppUserStore, {
|
addObservablesTo(AppUserStore, {
|
||||||
|
|
@ -16,9 +14,7 @@ addObservablesTo(AppUserStore, {
|
||||||
|
|
||||||
threadsAllowed: false,
|
threadsAllowed: false,
|
||||||
|
|
||||||
composeInEdit: false,
|
composeInEdit: false
|
||||||
|
|
||||||
contactsIsAllowed: false
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AppUserStore.focusedState.subscribe(value => {
|
AppUserStore.focusedState.subscribe(value => {
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ class ComposePopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
this.sLastFocusedField = 'to';
|
this.sLastFocusedField = 'to';
|
||||||
|
|
||||||
this.allowContacts = AppUserStore.contactsIsAllowed();
|
this.allowContacts = AppUserStore.allowContacts();
|
||||||
|
|
||||||
this.bSkipNextHide = false;
|
this.bSkipNextHide = false;
|
||||||
this.editorDefaultType = SettingsUserStore.editorDefaultType;
|
this.editorDefaultType = SettingsUserStore.editorDefaultType;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
|
||||||
capaAdditionalAccounts: Settings.capa(Capa.AdditionalAccounts)
|
capaAdditionalAccounts: Settings.capa(Capa.AdditionalAccounts)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.allowContacts = AppUserStore.contactsIsAllowed();
|
this.allowContacts = AppUserStore.allowContacts();
|
||||||
|
|
||||||
this.addAccountClick = this.addAccountClick.bind(this);
|
this.addAccountClick = this.addAccountClick.bind(this);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ export class FolderListMailBoxUserView extends AbstractViewLeft {
|
||||||
this.leftPanelDisabled = leftPanelDisabled;
|
this.leftPanelDisabled = leftPanelDisabled;
|
||||||
|
|
||||||
this.allowComposer = Settings.capa(Capa.Composer);
|
this.allowComposer = Settings.capa(Capa.Composer);
|
||||||
this.allowContacts = AppUserStore.contactsIsAllowed();
|
this.allowContacts = AppUserStore.allowContacts();
|
||||||
|
|
||||||
this.folderListFocused = ko.computed(() => Scope.FolderList === AppUserStore.focusedState());
|
this.folderListFocused = ko.computed(() => Scope.FolderList === AppUserStore.focusedState());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue