From f31e3ec577acfd4552fafae15968039735bb37d5 Mon Sep 17 00:00:00 2001 From: Spectralitree <72747870+Spectralitree@users.noreply.github.com> Date: Wed, 15 Dec 2021 13:56:36 +0100 Subject: [PATCH] feat: starting on a specific tab on the dash uses url params now --- src/lib/Navigation.svelte | 4 ++-- src/pages/Dash.svelte | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/lib/Navigation.svelte b/src/lib/Navigation.svelte index 3d24b822..74f7bab8 100644 --- a/src/lib/Navigation.svelte +++ b/src/lib/Navigation.svelte @@ -40,8 +40,8 @@ import { get } from 'svelte/store'; Dash - System - Members + System + Members Log out diff --git a/src/pages/Dash.svelte b/src/pages/Dash.svelte index 25d3d0b1..07fae917 100644 --- a/src/pages/Dash.svelte +++ b/src/pages/Dash.svelte @@ -6,14 +6,19 @@ import System from '../lib/system/Main.svelte'; import PKAPI from '../api'; import Sys from '../api/system'; + import List from '../lib/member/List.svelte'; let isPublic = false; // get the state from the navigator so that we know which tab to start on let location = useLocation(); - let tabPane = $location.state && $location.state.tab; - // if there is no state, default to system - if (tabPane === undefined) { + let params = $location.search && new URLSearchParams($location.search); + let tabPane: string; + if (params) { + tabPane = params.get("tab"); + } + + if (!tabPane) { tabPane = "system"; } @@ -70,10 +75,10 @@ - + - alo +