Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
cleanup for loading items
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Apr 9, 2024
1 parent d79e618 commit 2ebaca1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
24 changes: 23 additions & 1 deletion web/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@

<slot></slot>
<slot></slot>

<div>
<p>Data from <a href="https://github.com/usd-wg/assets" target="_blank">usd-wg/assets</a></p>
<p>
Made by <a href="https://twitter.com/hybridherbst" target="_blank">@hybridherbst</a>
from <a href="https://needle.tools" target="_blank">Needle</a>
and <a href="https://prefrontalcortex.de" target="_blank">prefrontal cortex</a></p>
</div>

<style>
div {
margin-top: 2em;
}
p {
padding: 0;
margin: 0;
color: rgba(0, 0, 0, 0.3);
}
</style>
2 changes: 1 addition & 1 deletion web/src/routes/[...path]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function load({ params }) {
const path = params.path;

const currentDir = dirs?.find(child => child.path === path || child.path === path + "/");
const currentItem = items?.find(item => item.path === path);
const currentItem = items?.find(item => item.path === path || item.path + "/" === path);

// console.log("Loading page: " + path + ", currentDir: " + currentDir + ", currentItem: " + currentItem);

Expand Down
4 changes: 1 addition & 3 deletions web/src/routes/[...path]/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script lang="ts">
import { base } from '$app/paths';
import type { HierarchyEntry, HierarchyItem } from '$lib/files';
import { onMount } from 'svelte';
import GridItem from '../GridItem.svelte';
import Breadcrumbs from '../Breadcrumbs.svelte';
import Breadcrumbs from '../Breadcrumbs.svelte';
export let data;
$: currentPath = data.currentItem ? data.currentItem.path : data.currentDir ? data.currentDir.path : "";
Expand Down

0 comments on commit 2ebaca1

Please sign in to comment.