mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
merge
This commit is contained in:
@@ -10,6 +10,12 @@ export class LocalstoreService {
|
||||
private prefix = environment.version.lastCommitNumber+"-";
|
||||
private previewPrefix = 'v17-';
|
||||
|
||||
callbacks: {[key: string]: {
|
||||
path: string,
|
||||
funx: Function,
|
||||
id: string
|
||||
}} = {}
|
||||
|
||||
constructor() {
|
||||
|
||||
const key = SHA1('version').toString()
|
||||
@@ -68,6 +74,22 @@ export class LocalstoreService {
|
||||
localStorage.removeItem(keyName)
|
||||
}
|
||||
|
||||
private async change(changeType: 'set' | 'delete') {
|
||||
const currentPath = window.location.pathname
|
||||
|
||||
for (const [key, value] of Object.entries(this.callbacks)) {
|
||||
|
||||
if(currentPath.startsWith(value.path)) {}
|
||||
const dontRepeat = await value.funx({event:{type: changeType}})
|
||||
if(dontRepeat) {
|
||||
delete this.callbacks[key]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
listener() {}
|
||||
|
||||
}
|
||||
|
||||
export const localstoreService = new LocalstoreService()
|
||||
Reference in New Issue
Block a user