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

Merge branch 'master' of github.com:bitwarden/browser

This commit is contained in:
Kyle Spearrin 2019-08-16 10:44:30 -04:00
commit 15d62e2d97

View File

@ -39,10 +39,17 @@ export class SafariApp {
}
private static receiveMessageFromApp(message: any) {
if (message == null || message.id == null || !(window as any).bitwardenSafariAppRequests.has(message.id)) {
if (message == null) {
return;
}
const p = (window as any).bitwardenSafariAppRequests.get(message.id);
p.resolve(message.responseData);
if (message.id == null && message.command === 'cs_message') {
try {
const msg = JSON.parse(message.data);
SafariApp.sendMessageToListeners(msg, 'cs_message', null);
} catch { }
} else if (message.id != null && (window as any).bitwardenSafariAppRequests.has(message.id)) {
const p = (window as any).bitwardenSafariAppRequests.get(message.id);
p.resolve(message.responseData);
}
}
}