mirror of
https://github.com/ivabus/gui
synced 2025-06-08 00:00:27 +03:00
hide installed button if nothing is installed
This commit is contained in:
parent
99cd1ce2db
commit
b95dd47075
1 changed files with 15 additions and 7 deletions
|
@ -10,6 +10,12 @@
|
||||||
export let activeOption: SideMenuOptions;
|
export let activeOption: SideMenuOptions;
|
||||||
|
|
||||||
$: needsUpdateCount = $packageList.filter((p) => p.state === PackageStates.NEEDS_UPDATE).length;
|
$: needsUpdateCount = $packageList.filter((p) => p.state === PackageStates.NEEDS_UPDATE).length;
|
||||||
|
$: hasInstalled = $packageList.some((p) => [
|
||||||
|
PackageStates.INSTALLED,
|
||||||
|
PackageStates.NEEDS_UPDATE,
|
||||||
|
PackageStates.UPDATING,
|
||||||
|
PackageStates.INSTALLING,
|
||||||
|
].includes(p.state));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<aside class="border-gray border border-t-0 border-b-0 border-l-0 p-2">
|
<aside class="border-gray border border-t-0 border-b-0 border-l-0 p-2">
|
||||||
|
@ -28,13 +34,15 @@
|
||||||
on:click={() => goto(`/?tab=${SideMenuOptions.all}`)}
|
on:click={() => goto(`/?tab=${SideMenuOptions.all}`)}
|
||||||
/>
|
/>
|
||||||
<hr />
|
<hr />
|
||||||
<MenuButton
|
{#if hasInstalled}
|
||||||
label="installed"
|
<MenuButton
|
||||||
icon="tea-checkmark"
|
label="installed"
|
||||||
active={activeOption === SideMenuOptions.installed}
|
icon="tea-checkmark"
|
||||||
on:click={() => goto(`/?tab=${SideMenuOptions.installed}`)}
|
active={activeOption === SideMenuOptions.installed}
|
||||||
/>
|
on:click={() => goto(`/?tab=${SideMenuOptions.installed}`)}
|
||||||
<hr />
|
/>
|
||||||
|
<hr />
|
||||||
|
{/if}
|
||||||
{#if needsUpdateCount}
|
{#if needsUpdateCount}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
label={$t("tags.installed_updates_available").toLowerCase()}
|
label={$t("tags.installed_updates_available").toLowerCase()}
|
||||||
|
|
Loading…
Reference in a new issue