diff --git a/client/package.json b/client/package.json index c076cee4a0d..4e0c6dfdb95 100644 --- a/client/package.json +++ b/client/package.json @@ -56,6 +56,7 @@ "jquery.cookie": "^1.4.1", "jspdf": "^2.4.0", "linkifyjs": "^2.1.9", + "localforage": "^1.10.0", "markdown-it": "^12.3.2", "markdown-it-regexp": "^0.4.0", "moment": "2.29.1", diff --git a/client/src/store/index.js b/client/src/store/index.js index dd99dabb3ca..f5ea87be2d3 100644 --- a/client/src/store/index.js +++ b/client/src/store/index.js @@ -6,6 +6,7 @@ import Vue from "vue"; import Vuex from "vuex"; import createCache from "vuex-cache"; import VuexPersistence from "vuex-persist"; +import localForage from "localforage"; import config from "config"; @@ -35,9 +36,9 @@ import { syncVuextoGalaxy } from "./syncVuextoGalaxy"; Vue.use(Vuex); -// Create vuexpersistence const panelsPersistence = new VuexPersistence({ - storage: window.localStorage, + storage: localForage, + asyncStorage: true, modules: ["panels"], }); @@ -49,7 +50,6 @@ export function createStore() { config: configStore, betaHistory: betaHistoryStore, panels: panelStore, - // TODO: please namespace all store modules gridSearch: gridSearchStore, histories: historyStore, diff --git a/client/src/store/panelStore.js b/client/src/store/panelStore.js index 1cd405a7bf5..09614b9f9d6 100644 --- a/client/src/store/panelStore.js +++ b/client/src/store/panelStore.js @@ -44,7 +44,6 @@ const actions = { }, fetchPanel: async ({ commit }, panelView) => { const { data } = await axios.get(`${getAppRoot()}api/tools?in_panel=true&view=${panelView}`); - // wait for 15 seconds before committing commit("savePanelView", { panelView, panel: data }); }, }; diff --git a/client/yarn.lock b/client/yarn.lock index 35640d3acdf..717dd855c8f 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -8093,6 +8093,13 @@ loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4 emojis-list "^3.0.0" json5 "^1.0.1" +localforage@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" + integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg== + dependencies: + lie "3.1.1" + locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -8966,12 +8973,17 @@ object-hash@^2.2.0: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5" integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw== -object-inspect@^1.11.0, object-inspect@^1.9.0: +object-inspect@^1.11.0: version "1.11.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== -object-is@^1.0.1, object-is@^1.1.4: +object-inspect@^1.9.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" + integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== + +object-is@^1.0.1: version "1.1.5" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== @@ -8979,6 +8991,14 @@ object-is@^1.0.1, object-is@^1.1.4: call-bind "^1.0.2" define-properties "^1.1.3" +object-is@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.4.tgz#63d6c83c00a43f4cbc9434eb9757c8a5b8565068" + integrity sha512-1ZvAZ4wlF7IyPVOcE1Omikt7UpaFlOQq0HlSti+ZvDH3UiD2brwGMwDbyV43jao2bKJ+4+WdPJHSd7kgzKYVqg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"