From d9840b32021037ea8835ab5cd903a0f6f0fd7547 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Sun, 5 Jan 2025 14:33:59 -0400 Subject: [PATCH] FIX: structuredClone isnt available on RN --- blue_modules/notifications.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blue_modules/notifications.js b/blue_modules/notifications.js index d75472aaa..39707eb72 100644 --- a/blue_modules/notifications.js +++ b/blue_modules/notifications.js @@ -14,6 +14,8 @@ export const NOTIFICATIONS_NO_AND_DONT_ASK_FLAG = 'NOTIFICATIONS_NO_AND_DONT_ASK let alreadyConfigured = false; let baseURI = groundControlUri; +const deepClone = obj => JSON.parse(JSON.stringify(obj)); + const checkAndroidNotificationPermission = async () => { try { const { status } = await checkNotifications(); @@ -323,8 +325,8 @@ export const configureNotifications = async onProcessNotifications => { }; const handleNotification = async notification => { - // Deep clone to avoid modifying the original object - const payload = structuredClone({ + // Deep clone to avoid modifying the original object + const payload = deepClone({ ...notification, ...notification.data, });