Skip to content

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

fix: sort multi keys

thecodrr528903cab761
diff --git a/apps/web/src/interfaces/storage.js b/apps/web/src/interfaces/storage.js
index 1cb41b0a9..4f79fadb7 100644
--- a/apps/web/src/interfaces/storage.js
+++ b/apps/web/src/interfaces/storage.js
@@ -2,6 +2,7 @@ import localforage from "localforage";
import { extendPrototype } from "localforage-getitems";
import { encode, decode } from "../utils/base64";
import { hexToBuffer, bufferToHex } from "../utils/hex";
+import sort from "fast-sort";
const encoder = new TextEncoder();
const decoder = new TextDecoder();
@@ -18,7 +19,7 @@ function read(key) {
function readMulti(keys) {
if (keys.length <= 0) return {};
- return localforage.getItems(keys);
+ return localforage.getItems(sort(keys).asc());
}
function write(key, data) {
diff --git a/apps/web/yarn.lock b/apps/web/yarn.lock
index a51f6f18a..25cbce3d3 100644
--- a/apps/web/yarn.lock
+++ b/apps/web/yarn.lock
@@ -6883,7 +6883,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#479f290b1b8c929eba45e27b1a8293f1a221de8a"
+ resolved "https://github.com/thecodrr/notes-core.git#c5f5a15cba00e0d56aa99fac19277b1ce3cd0454"
dependencies:
fast-sort "^2.0.1"
fuzzysearch "^1.0.3"