mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-06 06:52:20 +08:00
27 lines
664 B
JavaScript
27 lines
664 B
JavaScript
import { Scope } from 'Common/Enums';
|
|
import { keyScope, leftPanelDisabled, SettingsGet } from 'Common/Globals';
|
|
import { addObservablesTo } from 'Common/Utils';
|
|
import { ThemeStore } from 'Stores/Theme';
|
|
|
|
export const AppUserStore = {
|
|
allowContacts: () => !!SettingsGet('ContactsIsAllowed')
|
|
};
|
|
|
|
addObservablesTo(AppUserStore, {
|
|
focusedState: Scope.None,
|
|
|
|
threadsAllowed: false,
|
|
|
|
composeInEdit: false
|
|
});
|
|
|
|
AppUserStore.focusedState.subscribe(value => {
|
|
switch (value) {
|
|
case Scope.MessageList:
|
|
case Scope.MessageView:
|
|
case Scope.FolderList:
|
|
keyScope(value);
|
|
ThemeStore.isMobile() && leftPanelDisabled(Scope.FolderList !== value);
|
|
break;
|
|
}
|
|
});
|