enable clearing of pointer

This commit is contained in:
buzz-lightsnack-2007 2024-05-04 13:29:55 +08:00
parent 3dabfe7984
commit f7d5ccecb8

View file

@ -20,7 +20,7 @@ class pointer {
} catch(err) {}
// 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.
if ((state && (typeof state).includes(`obj`)) ? Object.keys(state).length : false) {
(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};