snappymail/dev/Stores/User/App.js
2023-02-22 17:43:54 +01:00

24 lines
735 B
JavaScript

import { keyScope, leftPanelDisabled, SettingsGet, elementById } from 'Common/Globals';
import { addObservablesTo } from 'External/ko';
import { ThemeStore } from 'Stores/Theme';
import { arePopupsVisible } from 'Knoin/Knoin';
export const AppUserStore = {
allowContacts: () => !!SettingsGet('contactsAllowed')
};
addObservablesTo(AppUserStore, {
focusedState: 'none',
threadsAllowed: false
});
AppUserStore.focusedState.subscribe(value => {
['FolderList','MessageList','MessageView'].forEach(name => {
if (name === value) {
arePopupsVisible() || keyScope(value);
ThemeStore.isMobile() && leftPanelDisabled('FolderList' !== value);
}
elementById('V-Mail'+name).classList.toggle('focused', name === value);
});
});