fixes bug hiding trails when filter empty
This commit is contained in:
@@ -49,15 +49,16 @@
|
|||||||
if (storedDisplayOption) {
|
if (storedDisplayOption) {
|
||||||
selectedDisplayOption = storedDisplayOption;
|
selectedDisplayOption = storedDisplayOption;
|
||||||
}
|
}
|
||||||
if (filter && storedSort) {
|
if (filter) {
|
||||||
filter.sort = storedSort as typeof filter.sort;
|
filter.sort =
|
||||||
|
(storedSort as typeof filter.sort | null) ?? filter.sort;
|
||||||
}
|
}
|
||||||
if (filter && storedSortOrder) {
|
if (filter) {
|
||||||
filter.sortOrder = storedSortOrder as typeof filter.sortOrder;
|
filter.sortOrder =
|
||||||
}
|
(storedSortOrder as typeof filter.sortOrder | null) ??
|
||||||
if (storedSort || storedSortOrder) {
|
filter.sortOrder;
|
||||||
dispatch("update", filter);
|
|
||||||
}
|
}
|
||||||
|
dispatch("update", filter);
|
||||||
});
|
});
|
||||||
|
|
||||||
function setDisplayOption() {
|
function setDisplayOption() {
|
||||||
@@ -148,9 +149,9 @@
|
|||||||
{:else}
|
{:else}
|
||||||
{#each { length: 12 } as _, index}
|
{#each { length: 12 } as _, index}
|
||||||
{#if selectedDisplayOption === "cards"}
|
{#if selectedDisplayOption === "cards"}
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<SkeletonCard></SkeletonCard>
|
<SkeletonCard></SkeletonCard>
|
||||||
</div>
|
</div>
|
||||||
{:else if selectedDisplayOption === "list"}
|
{:else if selectedDisplayOption === "list"}
|
||||||
<SkeletonListItem></SkeletonListItem>
|
<SkeletonListItem></SkeletonListItem>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -180,7 +181,8 @@
|
|||||||
data-sveltekit-preload-data="off"
|
data-sveltekit-preload-data="off"
|
||||||
>
|
>
|
||||||
{#if selectedDisplayOption === "cards"}
|
{#if selectedDisplayOption === "cards"}
|
||||||
<TrailCard fullWidth={fullWidthCards} {trail}></TrailCard>
|
<TrailCard fullWidth={fullWidthCards} {trail}
|
||||||
|
></TrailCard>
|
||||||
{:else}
|
{:else}
|
||||||
<TrailListItem {trail}></TrailListItem>
|
<TrailListItem {trail}></TrailListItem>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user