mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Resolve set(key, null) not working in safari
This commit is contained in:
@@ -20,6 +20,15 @@ export default class BrowserStorageService implements StorageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async save(key: string, obj: any): Promise<any> {
|
async save(key: string, obj: any): Promise<any> {
|
||||||
|
if (obj == null) {
|
||||||
|
// Fix safari not liking null in set
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
this.chromeStorageApi.remove(key, () => {
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const keyedObj = { [key]: obj };
|
const keyedObj = { [key]: obj };
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.chromeStorageApi.set(keyedObj, () => {
|
this.chromeStorageApi.set(keyedObj, () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user