From a1aff7aaebe047b608eeecc65535a55c57407c4b Mon Sep 17 00:00:00 2001 From: Evzen Gasta Date: Mon, 26 Aug 2024 13:31:43 +0200 Subject: [PATCH] chore: rebased Signed-off-by: Evzen Gasta --- packages/renderer/src/AppNavigation.svelte | 18 ++++++++---------- .../src/lib/authentication/AuthActions.svelte | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/renderer/src/AppNavigation.svelte b/packages/renderer/src/AppNavigation.svelte index 06dfece7c265b..0eaada6f8881d 100644 --- a/packages/renderer/src/AppNavigation.svelte +++ b/packages/renderer/src/AppNavigation.svelte @@ -5,6 +5,8 @@ import { Tooltip } from '@podman-desktop/ui-svelte'; import { onMount } from 'svelte'; import type { TinroRouteMeta } from 'tinro'; +import { NavigationPage } from '/@api/navigation-page'; + import AuthActions from './lib/authentication/AuthActions.svelte'; import { CommandRegistry } from './lib/CommandRegistry'; import NewContentOnDashboardBadge from './lib/dashboard/NewContentOnDashboardBadge.svelte'; @@ -14,21 +16,16 @@ import SettingsIcon from './lib/images/SettingsIcon.svelte'; import NavItem from './lib/ui/NavItem.svelte'; import NavRegistryEntry from './lib/ui/NavRegistryEntry.svelte'; import NavSection from './lib/ui/NavSection.svelte'; +import { handleNavigation } from './navigation'; import { navigationRegistry } from './stores/navigation/navigation-registry'; -let { - exitSettingsCallback, - meta = $bindable(), -}: { - exitSettingsCallback: () => void; - meta: TinroRouteMeta; -} = $props(); - -const iconSize = '22'; +let { exitSettingsCallback, meta = $bindable() }: { exitSettingsCallback: () => void; meta: TinroRouteMeta } = $props(); let authActions = $state(); let outsideWindow = $state(); +const iconSize = '22'; + onMount(async () => { const commandRegistry = new CommandRegistry(); commandRegistry.init(); @@ -38,7 +35,7 @@ function clickSettings(b: boolean) { if (b) { exitSettingsCallback(); } else { - window.location.href = '#/preferences/resources'; + handleNavigation({ page: NavigationPage.RESOURCES }); } } @@ -61,6 +58,7 @@ function clickSettings(b: boolean) { {@const allItemsHidden = (navigationRegistryItem.items ?? []).every(item => item.hidden)} {#if !allItemsHidden} + {#if navigationRegistryItem.items} diff --git a/packages/renderer/src/lib/authentication/AuthActions.svelte b/packages/renderer/src/lib/authentication/AuthActions.svelte index 4546567840eaf..54edcafb124a5 100644 --- a/packages/renderer/src/lib/authentication/AuthActions.svelte +++ b/packages/renderer/src/lib/authentication/AuthActions.svelte @@ -47,7 +47,6 @@ export function onButtonClick(e: MouseEvent): void { onClick={() => handleNavigation({ page: NavigationPage.AUTHENTICATION })} /> {#each $authenticationProviders as provider} - {console.error(provider)} {@const sessionRequests = provider.sessionRequests ?? []} {#if provider?.accounts?.length > 0} {#each provider.accounts as account}