mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
Parse web push payload JSON (#13594)
This commit is contained in:
@@ -12,7 +12,16 @@ export class NotificationResponse extends BaseResponse {
|
||||
this.contextId = this.getResponseProperty("ContextId");
|
||||
this.type = this.getResponseProperty("Type");
|
||||
|
||||
const payload = this.getResponseProperty("Payload");
|
||||
let payload = this.getResponseProperty("Payload");
|
||||
|
||||
if (typeof payload === "string") {
|
||||
try {
|
||||
payload = JSON.parse(payload);
|
||||
} catch {
|
||||
// guess it was a string
|
||||
}
|
||||
}
|
||||
|
||||
switch (this.type) {
|
||||
case NotificationType.SyncCipherCreate:
|
||||
case NotificationType.SyncCipherDelete:
|
||||
|
||||
Reference in New Issue
Block a user