1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

revert changing selectedNamespaces default value

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-03-31 16:07:51 -04:00
parent f4ce27dc0d
commit 3dcfe4c7cf
2 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@ import { Namespace, namespacesApi } from "../../api/endpoints/namespaces.api";
import { createPageParam } from "../../navigation";
import { apiManager } from "../../api/api-manager";
const selectedNamespaces = createStorage<string[]>("selected_namespaces", []);
const selectedNamespaces = createStorage<string[] | undefined>("selected_namespaces", undefined);
export const namespaceUrlParam = createPageParam<string[]>({
name: "namespaces",

View File

@ -134,7 +134,8 @@ export class StorageHelper<T> {
set(value: T) {
if (value == null) {
this.reset();
// This cannot use recursion because defaultValue might be null or undefined
this.data.set(this.defaultValue);
} else {
this.data.set(value);
}