Skip to content

Commit b9983e4

Browse files
committed
Keeping input on Show All button press
1 parent 26f8a7e commit b9983e4

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

frontend/src/lib/components/mods-list/ModsList.svelte

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,28 @@
184184
{#if displayMods.length === 0 && !fetchingMods && !filteringMods && $hasFetchedMods}
185185
<div class="flex flex-col h-full items-center justify-center">
186186
{#if mods.length !== 0}
187-
<p class="text-xl text-center text-surface-400-700-token"><T defaultValue="No mods matching your filters" keyName="mods-list.no-mods-filtered"/></p>
188-
<button
189-
class="btn variant-filled-primary mt-4"
190-
on:click={() => {
191-
$search = '';
192-
$filter = filterOptions[0];
193-
}}
194-
>
195-
<T defaultValue="Show all" keyName="mods-list.show-all"/>
196-
</button>
187+
{#if $filter != filterOptions[0]}
188+
<p class="text-xl text-center text-surface-400-700-token"><T defaultValue="No mods matching your filters" keyName="mods-list.no-mods-filtered"/></p>
189+
<button
190+
class="btn variant-filled-primary mt-4"
191+
on:click={() => {
192+
$filter = filterOptions[0];
193+
}}
194+
>
195+
<T defaultValue="Show all" keyName="mods-list.show-all"/>
196+
</button>
197+
{:else}
198+
<p class="text-xl text-center text-surface-400-700-token"><T defaultValue="No mods matching your filters" keyName="mods-list.no-mods-filtered"/></p>
199+
<button
200+
class="btn variant-filled-primary mt-4"
201+
on:click={() => {
202+
$search = '';
203+
$filter = filterOptions[0];
204+
}}
205+
>
206+
<T defaultValue="Show all" keyName="mods-list.show-all"/>
207+
</button>
208+
{/if}
197209
{:else}
198210
<p class="text-xl text-center text-surface-400-700-token"><T defaultValue="No mods found" keyName="mods-list.no-mods-found"/></p>
199211
{/if}

0 commit comments

Comments
 (0)