Skip to content

Commit

Permalink
Ignore nodes with 0 routes
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodiesHQ committed May 29, 2024
1 parent ca47ea4 commit f1c2a2d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/routes/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import CardListPage from '$lib/cards/CardListPage.svelte';
import CardTilePage from '$lib/cards/CardTilePage.svelte';
import PageHeader from '$lib/page/PageHeader.svelte';
import { LayoutNodeStore, NodeStore } from '$lib/Stores';
import { LayoutNodeStore, NodeStore, RouteStore } from '$lib/Stores';
import { get } from 'svelte/store';
import { onMount } from 'svelte';
import RouteListCard from '$lib/cards/route/RouteListCard.svelte';
import RouteTileCard from '$lib/cards/route/RouteTileCard.svelte';
import Page from '$lib/page/Page.svelte';
import type { Direction, Node } from '$lib/common/types';
import type { Direction, Node, Route } from '$lib/common/types';
import SortBtn from '$lib/parts/SortBtn.svelte';
$: layout = get(LayoutNodeStore);
Expand Down Expand Up @@ -63,6 +63,10 @@
}
function filter(node: Node, filterString: string): boolean {
const routes = get(RouteStore).filter((r) => (r.node ?? r.machine).id == node.id)
if (routes.length == 0) {
return false
}
if (filterString === '') {
return true;
}
Expand Down

0 comments on commit f1c2a2d

Please sign in to comment.