mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 21:49:21 +03:00
Simplify save settings
This commit is contained in:
parent
fc60dc94fc
commit
f4d98130a5
12 changed files with 66 additions and 162 deletions
|
|
@ -8,14 +8,17 @@ import Remote from 'Remote/Admin/Fetch';
|
|||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
import { PluginPopupView } from 'View/Popup/Plugin';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||
import { AbstractViewSettings } from 'Knoin/AbstractViews';
|
||||
|
||||
export class PackagesAdminSettings /*extends AbstractViewSettings*/ {
|
||||
export class PackagesAdminSettings extends AbstractViewSettings {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.addSettings(['EnabledPlugins']);
|
||||
|
||||
addObservablesTo(this, {
|
||||
packagesError: '',
|
||||
enabledPlugins: !!SettingsGet('EnabledPlugins')
|
||||
packagesError: ''
|
||||
});
|
||||
|
||||
this.packages = PackageAdminStore;
|
||||
|
|
@ -27,12 +30,6 @@ export class PackagesAdminSettings /*extends AbstractViewSettings*/ {
|
|||
|
||||
visibility: () => (PackageAdminStore.loading() ? 'visible' : 'hidden')
|
||||
});
|
||||
|
||||
this.enabledPlugins.subscribe(value =>
|
||||
Remote.saveConfig({
|
||||
EnabledPlugins: value ? 1 : 0
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
onShow() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue