From 30e316e6abdade912f248219912f9441c5e46867 Mon Sep 17 00:00:00 2001 From: Yangjun Wang Date: Sat, 19 Sep 2020 20:53:55 +0300 Subject: [PATCH] revert unnecessary format Signed-off-by: Yangjun Wang --- .../components/+namespaces/namespace.store.ts | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/renderer/components/+namespaces/namespace.store.ts b/src/renderer/components/+namespaces/namespace.store.ts index eccc2c9a9c..c9f190be97 100644 --- a/src/renderer/components/+namespaces/namespace.store.ts +++ b/src/renderer/components/+namespaces/namespace.store.ts @@ -27,32 +27,29 @@ export class NamespaceStore extends KubeObjectStore { this.updateUrl(namespaces); // sync with local-storage & url-search-params - reaction( - () => this.contextNs.toJS(), - (namespaces) => { - this.storage.set(namespaces); - this.updateUrl(namespaces); - } - ); + reaction(() => this.contextNs.toJS(), namespaces => { + this.storage.set(namespaces); + this.updateUrl(namespaces); + }); } getContextParams(): Partial { return { - namespaces: this.contextNs, - }; + namespaces: this.contextNs + } } protected updateUrl(namespaces: string[]) { - setQueryParams({ namespaces }, { replace: true }); + setQueryParams({ namespaces }, { replace: true }) } protected async loadItems(namespaces?: string[]) { if (!isAllowedResource("namespaces")) { if (namespaces) return namespaces.map(this.getDummyNamespace); - return []; + return [] } if (namespaces) { - return Promise.all(namespaces.map((name) => this.api.get({ name }))); + return Promise.all(namespaces.map(name => this.api.get({ name }))) } else { return super.loadItems(); } @@ -66,9 +63,9 @@ export class NamespaceStore extends KubeObjectStore { name: name, uid: "", resourceVersion: "", - selfLink: `/api/v1/namespaces/${name}`, - }, - }); + selfLink: `/api/v1/namespaces/${name}` + } + }) } setContext(namespaces: string[]) { @@ -77,7 +74,7 @@ export class NamespaceStore extends KubeObjectStore { hasContext(namespace: string | string[]) { const context = Array.isArray(namespace) ? namespace : [namespace]; - return context.every((namespace) => this.contextNs.includes(namespace)); + return context.every(namespace => this.contextNs.includes(namespace)); } toggleContext(namespace: string) {