isArray to native Array.isArray

isUnd(*) to native undefined === *
isFunc to native typeof * === 'function'
isObject to native typeof * === 'object'
microtime() to native Date().getTime();
noop to native ()=>{}
noopFalse to native ()=>false
noopTrue to native ()=>true
boolToAjax to native *?'1':'0'
Underscore.js to native
This commit is contained in:
djmaze 2020-07-29 21:49:41 +02:00
parent fa39c7ecba
commit ea48f5060b
72 changed files with 551 additions and 775 deletions

View file

@ -1,8 +1,7 @@
import ko from 'ko';
import { delegateRunOnDestroy, boolToAjax } from 'Common/Utils';
import { delegateRunOnDestroy } from 'Common/Utils';
import { Magics } from 'Common/Enums';
import { bIsHttps } from 'Common/Globals';
import PgpStore from 'Stores/User/Pgp';
import SettingsStore from 'Stores/User/Settings';
@ -22,8 +21,6 @@ class OpenPgpUserSettings {
this.openPgpKeyForDeletion = ko.observable(null).deleteAccessHelper();
this.allowDraftAutosave = SettingsStore.allowDraftAutosave;
this.isHttps = bIsHttps;
}
addOpenPgpKey() {
@ -66,7 +63,7 @@ class OpenPgpUserSettings {
onBuild() {
setTimeout(() => {
this.allowDraftAutosave.subscribe(Remote.saveSettingsHelper('AllowDraftAutosave', boolToAjax));
this.allowDraftAutosave.subscribe(Remote.saveSettingsHelper('AllowDraftAutosave', v=>v?'1':'0'));
}, Magics.Time50ms);
}
}