mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-24 12:06:15 +01:00
always read before writing
This commit is contained in:
parent
9b3fddbd33
commit
22c12cf5c4
@ -30,7 +30,7 @@ export class LowdbStorageService implements StorageService {
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
if (this.defaults != null) {
|
if (this.defaults != null) {
|
||||||
this.db.defaults(this.defaults).write();
|
this.db.read().defaults(this.defaults).write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,12 +43,12 @@ export class LowdbStorageService implements StorageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
save(key: string, obj: any): Promise<any> {
|
save(key: string, obj: any): Promise<any> {
|
||||||
this.db.set(key, obj).write();
|
this.db.read().set(key, obj).write();
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
remove(key: string): Promise<any> {
|
remove(key: string): Promise<any> {
|
||||||
this.db.unset(key).write();
|
this.db.read().unset(key).write();
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user