Skip to content

Commit

Permalink
Update store.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
akabutnicer authored Feb 21, 2024
1 parent 9f7a99d commit 3b0d52a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/emoji-mart/src/helpers/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ function getIDB() {
if (typeof msIndexedDB !== 'undefined') {
return msIndexedDB;
}
return;
} catch (e) {
return;
}

}

var idb = getIDB();
Expand All @@ -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");
Expand All @@ -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) {}
Expand Down

0 comments on commit 3b0d52a

Please sign in to comment.