Skip to content

Commit 46bc154

Browse files
authored
fix: Saving new filter in data browser overwrites filters added in other dashboard instances (#2769)
1 parent 8a9e494 commit 46bc154

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/lib/ClassPreferences.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
const VERSION = 1; // In case we ever need to invalidate these
2-
const cache = {};
32
export function updatePreferences(prefs, appId, className) {
43
try {
54
localStorage.setItem(path(appId, className), JSON.stringify(prefs));
65
} catch {
76
// Fails in Safari private browsing
87
}
9-
cache[appId] = cache[appId] || {};
10-
cache[appId][className] = prefs;
118
}
129

1310
export function getPreferences(appId, className) {
14-
if (cache[appId] && cache[appId][className]) {
15-
return cache[appId][className];
16-
}
1711
let entry;
1812
try {
1913
entry =
@@ -29,10 +23,7 @@ export function getPreferences(appId, className) {
2923
return null;
3024
}
3125
try {
32-
const prefs = JSON.parse(entry);
33-
cache[appId] = cache[appId] || {};
34-
cache[appId][className] = prefs;
35-
return prefs;
26+
return JSON.parse(entry);
3627
} catch {
3728
return null;
3829
}

0 commit comments

Comments
 (0)