1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-05 09:10:53 +01:00

Resolve set(key, null) not working in safari

This commit is contained in:
Hinton 2021-01-13 16:43:18 +01:00
parent f6ae483b65
commit 313ecdcd5e

View File

@ -20,6 +20,15 @@ export default class BrowserStorageService implements StorageService {
}
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 };
return new Promise((resolve) => {
this.chromeStorageApi.set(keyedObj, () => {