1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

storage service communicating with swift app

This commit is contained in:
Kyle Spearrin
2019-08-14 12:53:43 -04:00
parent e36063ff7a
commit 68593e9df2
2 changed files with 35 additions and 11 deletions

View File

@@ -36,10 +36,10 @@ export default class BrowserStorageService implements StorageService {
async save(key: string, obj: any): Promise<any> {
const keyedObj = { [key]: obj };
if (this.isSafari) {
await SafariApp.sendMessageToApp('storage_save', {
await SafariApp.sendMessageToApp('storage_save', JSON.stringify({
key: key,
obj: JSON.stringify(obj),
});
}));
} else {
return new Promise((resolve) => {
this.chromeStorageApi.set(keyedObj, () => {