From c90bfd55cfe1ca137376fd4dd073486d83df761b Mon Sep 17 00:00:00 2001 From: Th1nkK1D Date: Fri, 14 Jun 2024 15:38:49 +0700 Subject: [PATCH] fix: remove all pre-mount skeleton --- .../Assemblies/Members/Header.svelte | 4 +-- src/components/Assemblies/SeatChart.svelte | 10 ++---- .../[id]/members/[groupby]/+page.svelte | 31 +++---------------- 3 files changed, 8 insertions(+), 37 deletions(-) diff --git a/src/components/Assemblies/Members/Header.svelte b/src/components/Assemblies/Members/Header.svelte index 15537c4d..7af3c3a3 100644 --- a/src/components/Assemblies/Members/Header.svelte +++ b/src/components/Assemblies/Members/Header.svelte @@ -17,7 +17,6 @@ $: ({ assembly } = data); export let searchQuery = ''; - export let mounted = false; diff --git a/src/components/Assemblies/SeatChart.svelte b/src/components/Assemblies/SeatChart.svelte index 06d95c46..1fe60e28 100644 --- a/src/components/Assemblies/SeatChart.svelte +++ b/src/components/Assemblies/SeatChart.svelte @@ -100,21 +100,15 @@ ); }; - let mounted = false; onMount(() => { - mounted = true; + redraw(); + window.addEventListener('resize', redraw); return () => { window.removeEventListener('resize', redraw); }; }); - - $: if (mounted) { - parties; - lineAmounts; - redraw(); - }
{ - mounted = true; - showFilter = window.matchMedia(`(min-width: 672px)`).matches; isMobile = !showFilter; if (showFilter) { @@ -103,7 +100,7 @@ }); -
+
{#if showFilter} @@ -111,13 +108,7 @@ class="member-aside fixed bottom-0 left-0 right-0 top-0 z-40 flex flex-col gap-4 bg-white px-6 md:sticky md:top-[80px] md:z-0 md:h-[calc(100dvh-80px)] md:w-[250px] md:flex-none" >
- +
{#if currentPath === GroupByOption.Party}
- - + +
{/if}
{#if isDataHasSubgroup} - + {#each filteredGroup as group (group.name)} {#if 'subgroups' in group} @@ -299,7 +279,6 @@ on:click={() => { showFilter = true; }} - skeleton={!mounted} /> {/if}