This commit is contained in:
Peter Maquiran
2021-07-18 20:52:14 +01:00
parent 9e9f72da3e
commit f28e4a1d04
2 changed files with 14 additions and 3 deletions
+13 -2
View File
@@ -6,13 +6,22 @@ import { AES, enc, SHA1 } from 'crypto-js'
})
export class LocalstoreService {
private prefix = 'v0-'
private prefix = 'v2-'
constructor() { }
constructor() {
const key = SHA1('version').toString()
if(this.get(key, false)) {
// alert('new Update')
}
this.set(key, this.prefix)
}
getKey(keyName) {
return this.prefix + keyName
}
get( keyName, safe) {
keyName = this.getKey(keyName)
@@ -30,6 +39,8 @@ export class LocalstoreService {
return decryptedData;
}
} else {
return safe
}
}