mirror of https://github.com/gorhill/uBlock.git
minor code review
This commit is contained in:
parent
fd454e272d
commit
7702b1f4bc
|
@ -54,11 +54,6 @@
|
||||||
µBlock.saveLocalSettings = (function() {
|
µBlock.saveLocalSettings = (function() {
|
||||||
let saveAfter = 4 * 60 * 1000;
|
let saveAfter = 4 * 60 * 1000;
|
||||||
|
|
||||||
let save = function(callback) {
|
|
||||||
this.localSettingsLastSaved = Date.now();
|
|
||||||
vAPI.storage.set(this.localSettings, callback);
|
|
||||||
};
|
|
||||||
|
|
||||||
let onTimeout = ( ) => {
|
let onTimeout = ( ) => {
|
||||||
let µb = µBlock;
|
let µb = µBlock;
|
||||||
if ( µb.localSettingsLastModified > µb.localSettingsLastSaved ) {
|
if ( µb.localSettingsLastModified > µb.localSettingsLastSaved ) {
|
||||||
|
@ -69,7 +64,10 @@
|
||||||
|
|
||||||
vAPI.setTimeout(onTimeout, saveAfter);
|
vAPI.setTimeout(onTimeout, saveAfter);
|
||||||
|
|
||||||
return save;
|
return function(callback) {
|
||||||
|
this.localSettingsLastSaved = Date.now();
|
||||||
|
vAPI.storage.set(this.localSettings, callback);
|
||||||
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue