enable clearing of pointer
This commit is contained in:
parent
3dabfe7984
commit
f7d5ccecb8
1 changed files with 15 additions and 2 deletions
|
@ -20,7 +20,7 @@ class pointer {
|
||||||
} catch(err) {}
|
} catch(err) {}
|
||||||
|
|
||||||
// Get the last edited site.
|
// Get the last edited site.
|
||||||
return(global.write([`last`, `URL`], this.URL));
|
return(global.write([`last`, `URL`], this.URL, -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -32,10 +32,23 @@ class pointer {
|
||||||
// Indicate the status of the process.
|
// Indicate the status of the process.
|
||||||
if ((state && (typeof state).includes(`obj`)) ? Object.keys(state).length : false) {
|
if ((state && (typeof state).includes(`obj`)) ? Object.keys(state).length : false) {
|
||||||
(Object.keys(state)).forEach(async (key) => {
|
(Object.keys(state)).forEach(async (key) => {
|
||||||
await global.write([`last`, key], state[key]);
|
await global.write([`last`, key], state[key], -1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static read() {
|
||||||
|
return(global.read([`last`]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Clear the pointer.
|
||||||
|
|
||||||
|
@param {boolean} silent don't request a response.
|
||||||
|
*/
|
||||||
|
static clear(silent = true) {
|
||||||
|
return (global.forget([`last`], 0, silent))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {pointer as default};
|
export {pointer as default};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue