Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: make localforage-getitems work

thecodrr78d97fba27a0
diff --git a/apps/web/src/interfaces/storage.js b/apps/web/src/interfaces/storage.js
index 7439a80f1..1cb41b0a9 100644
--- a/apps/web/src/interfaces/storage.js
+++ b/apps/web/src/interfaces/storage.js
@@ -1,12 +1,14 @@
import localforage from "localforage";
+import { extendPrototype } from "localforage-getitems";
import { encode, decode } from "../utils/base64";
import { hexToBuffer, bufferToHex } from "../utils/hex";
const encoder = new TextEncoder();
const decoder = new TextDecoder();
+extendPrototype(localforage);
+
localforage.config({
name: "Notesnook",
- storeName: "Notesnook store",
driver: [localforage.INDEXEDDB, localforage.WEBSQL, localforage.LOCALSTORAGE]
});
@@ -15,6 +17,7 @@ function read(key) {
}
function readMulti(keys) {
+ if (keys.length <= 0) return {};
return localforage.getItems(keys);
}
diff --git a/apps/web/yarn.lock b/apps/web/yarn.lock
index a934532ee..079e79e63 100644
--- a/apps/web/yarn.lock
+++ b/apps/web/yarn.lock
@@ -6884,7 +6884,7 @@ normalize-url@^3.0.0, normalize-url@^3.0.1:
"notes-core@https://github.com/thecodrr/notes-core.git":
version "1.2.0"
- resolved "https://github.com/thecodrr/notes-core.git#ad90f7747165db301cff457b0f702a147977ca47"
+ resolved "https://github.com/thecodrr/notes-core.git#0efb3e81c5859430894022d6f738a7dab127e14f"
dependencies:
fast-sort "^2.0.1"
fuzzysearch "^1.0.3"