Navigate back to last viewed catalog catagory (#3163)

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-06-23 15:53:22 -04:00
1 parent e49576ee8c
commit 7058193295
4 files changed
+15 -4

No files matched your search

+4 -1
View File
@@ -41,8 +41,11 @@ const storage = observable({
* @param defaultValue
*/
export function createStorage<T>(key: string, defaultValue: T) {
return createAppStorage(key, defaultValue, getHostedClusterId());
}
export function createAppStorage<T>(key: string, defaultValue: T, clusterId?: string | undefined) {
const { logPrefix } = StorageHelper;
const clusterId = getHostedClusterId();
const folder = path.resolve((app || remote.app).getPath("userData"), "lens-local-storage");
const fileName = `${clusterId ?? "app"}.json`;
const filePath = path.resolve(folder, fileName);