mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-23 11:56:00 +01:00
Merge branch 'master' of github.com:bitwarden/browser
This commit is contained in:
commit
15d62e2d97
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user