From 405f3dbee598bb1a93c963007b41a452fed81e99 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Wed, 19 May 2021 11:40:51 +0300 Subject: [PATCH] Cleaning up Signed-off-by: Alex Andreev --- .../+extensions/extension-install.store.ts | 16 ++++----- .../components/+extensions/extensions.tsx | 2 +- .../+extensions/installed-extensions.tsx | 36 +++++++++---------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/renderer/components/+extensions/extension-install.store.ts b/src/renderer/components/+extensions/extension-install.store.ts index 32bdb21f56..ca185651de 100644 --- a/src/renderer/components/+extensions/extension-install.store.ts +++ b/src/renderer/components/+extensions/extension-install.store.ts @@ -212,42 +212,42 @@ export class ExtensionInstallationStateStore { /** * The current number of extensions uninstalling */ - @computed static get uninstalling(): number { + static get uninstalling(): number { return ExtensionInstallationStateStore.UninstallingExtensions.size; } /** * If there is at least one extension currently installing */ - @computed static get anyInstalling(): boolean { + static get anyInstalling(): boolean { return ExtensionInstallationStateStore.installing > 0; } /** * If there is at least one extension currently ininstalling */ - @computed static get anyUninstalling(): boolean { + static get anyUninstalling(): boolean { return ExtensionInstallationStateStore.uninstalling > 0; } /** * The current number of extensions preinstalling */ - @computed static get preinstalling(): number { + static get preinstalling(): number { return ExtensionInstallationStateStore.PreInstallIds.size; } /** * If there is at least one extension currently downloading */ - @computed static get anyPreinstalling(): boolean { + static get anyPreinstalling(): boolean { return ExtensionInstallationStateStore.preinstalling > 0; } /** - * If there is at least one installing or preinstalling step taking place - */ - @computed static get anyPreInstallingOrInstalling(): boolean { + * If there is at least one installing or preinstalling step taking place + */ + static get anyPreInstallingOrInstalling(): boolean { return ExtensionInstallationStateStore.anyInstalling || ExtensionInstallationStateStore.anyPreinstalling; } } diff --git a/src/renderer/components/+extensions/extensions.tsx b/src/renderer/components/+extensions/extensions.tsx index 8f9585165b..a751a8130f 100644 --- a/src/renderer/components/+extensions/extensions.tsx +++ b/src/renderer/components/+extensions/extensions.tsx @@ -534,7 +534,7 @@ export class Extensions extends React.Component { installPath={this.installPath} /> - {extensions.length &&
} + {extensions.length > 0 &&
} { - if (!ExtensionDiscovery.getInstance().isLoaded) { - return
; - } - - if (extensions.length == 0) { - return ( -
- -

- There are no extensions installed. -

-

Please use the form above to install or drag tarbar-file here.

-
- ); - } - const filters = [ (extension: InstalledExtension) => extension.manifest.name, (extension: InstalledExtension) => getStatus(extension.isEnabled), (extension: InstalledExtension) => extension.manifest.version, ]; - const columns: Column[] = useMemo( + const columns = useMemo( () => [ { Header: "Name", @@ -155,6 +139,22 @@ export const InstalledExtensions = observer(({ extensions, uninstall, enable, di }, [extensions, ExtensionInstallationStateStore.anyUninstalling] ); + if (!ExtensionDiscovery.getInstance().isLoaded) { + return
; + } + + if (extensions.length == 0) { + return ( +
+ +

+ There are no extensions installed. +

+

Please use the form above to install or drag tarbar-file here.

+
+ ); + } + return (