mirror of
https://github.com/bitwarden/browser
synced 2024-12-24 17:11:55 +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