From 3b0d52a6213341b6b1539c56dd3aad912c7bb7bd Mon Sep 17 00:00:00 2001 From: "Aka, but nice" <120267628+akabutnicer@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:55:20 -0500 Subject: [PATCH] Update store.ts --- packages/emoji-mart/src/helpers/store.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/emoji-mart/src/helpers/store.ts b/packages/emoji-mart/src/helpers/store.ts index 436b364e..fb28059b 100644 --- a/packages/emoji-mart/src/helpers/store.ts +++ b/packages/emoji-mart/src/helpers/store.ts @@ -15,9 +15,11 @@ function getIDB() { if (typeof msIndexedDB !== 'undefined') { return msIndexedDB; } + return; } catch (e) { return; } + } var idb = getIDB(); @@ -27,7 +29,7 @@ function getStore(callback, error) { db.onupgradeneeded = function () { db.result.createObjectStore("emoji-store"); }; - db.onsuccess = ({ result }) => { + db.onsuccess = ({ target: { result } }) => { const store = result .transaction("emoji-store", "readwrite") .objectStore("emoji-store"); @@ -51,7 +53,7 @@ function set(key: string, value: string) { } function get(key: string): any { try { - return runStoreCommand("get", `emoji-mart.${key}`, function ({ result }) { + return runStoreCommand("get", `emoji-mart.${key}`, function ({ target: { result } }) { return JSON.parse(result); }); } catch (error) {}