1
0
Fork 0

Compare commits

...

4 commits

Author SHA1 Message Date
Leon Grünewald
f9408d5d53 Add tab 2024-03-29 13:32:38 +01:00
Leon Grünewald
e844b67e45 Fix inital page load search 2024-03-29 13:32:31 +01:00
Leon Grünewald
42a300de0a Yeet .vscode 2024-03-29 13:32:22 +01:00
Leon Grünewald
a16d2de0b8 Clean up code 2024-03-29 13:32:13 +01:00
6 changed files with 21 additions and 17 deletions

2
.gitignore vendored
View file

@ -15,7 +15,6 @@ dist-ssr
# Editor directories and files # Editor directories and files
.vscode/* .vscode/*
!.vscode/extensions.json
.idea .idea
.DS_Store .DS_Store
*.suo *.suo
@ -23,4 +22,3 @@ dist-ssr
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?

View file

@ -12,6 +12,7 @@
<Tab class="text-dark-token" bind:group={tabPos} name="tab1" value={0}>Display</Tab> <Tab class="text-dark-token" bind:group={tabPos} name="tab1" value={0}>Display</Tab>
<Tab class="text-dark-token" bind:group={tabPos} name="tab2" value={1}>API</Tab> <Tab class="text-dark-token" bind:group={tabPos} name="tab2" value={1}>API</Tab>
<Tab class="text-dark-token" bind:group={tabPos} name="tab3" value={2}>User</Tab> <Tab class="text-dark-token" bind:group={tabPos} name="tab3" value={2}>User</Tab>
<Tab class="text-dark-token" bind:group={tabPos} name="tab4" value={3}>Chats</Tab>
<svelte:fragment slot="panel"> <svelte:fragment slot="panel">
{#if tabPos === 0} {#if tabPos === 0}
@ -73,6 +74,15 @@
</div> </div>
</div> </div>
{/if} {/if}
{#if tabPos === 3}
<div class="flex flex-col gap-3">
<div class="">
<p class="text-dark-token font-bold">Chats</p>
<InputChip name="blacklist" label="Blacklist" bind:value={$blacklist} />
</div>
</div>
{/if}
</svelte:fragment> </svelte:fragment>
</TabGroup> </TabGroup>
</div> </div>

View file

@ -15,7 +15,7 @@
import PostList from '$lib/PostList'; import PostList from '$lib/PostList';
const drawerStore = getDrawerStore(); const drawerStore = getDrawerStore();
const toastStore = getToastStore(); let initalSearch = true;
function onSearch() { function onSearch() {
$loading = true; $loading = true;
@ -25,11 +25,14 @@
}); });
} }
if ($postSearchResults === null) {
onSearch();
}
lastSearch.subscribe(() => { lastSearch.subscribe(() => {
if (initalSearch) {
initalSearch = false;
if ($postSearchResults === null) onSearch();
return
}
onSearch(); onSearch();
}) })
</script> </script>

View file

@ -1,12 +1,6 @@
import { invoke } from "@tauri-apps/api/tauri";
export const ssr = false; export const ssr = false;
/** @type {import('./$types').PageLoad} */ /** @type {import('./$types').PageLoad} */
export async function load({ params }) { export async function load({ params }) {
// const post = await invoke('get_post', {post_id: params.post_id}); return { postId: params.post_id };
return {
postId: params.post_id
};
} }

View file

@ -13,7 +13,6 @@
import { BackAppRailAnchor, GlobalSearch, PostMedia, SearchAppRailAnchor } from '$lib/components'; import { BackAppRailAnchor, GlobalSearch, PostMedia, SearchAppRailAnchor } from '$lib/components';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { loading, showSearch } from '$lib/stores'; import { loading, showSearch } from '$lib/stores';
import { limitImageHeight } from '$lib/settings.js';
import { TAG_TYPES } from '$lib/Tags'; import { TAG_TYPES } from '$lib/Tags';
import { invoke } from '@tauri-apps/api/tauri'; import { invoke } from '@tauri-apps/api/tauri';