diff --git a/src/routes/[spaceId]/channel/[channelId]/+page.svelte b/src/routes/[spaceId]/channel/[channelId]/+page.svelte index 848a340..9ac6823 100644 --- a/src/routes/[spaceId]/channel/[channelId]/+page.svelte +++ b/src/routes/[spaceId]/channel/[channelId]/+page.svelte @@ -3,24 +3,14 @@ import ChatInput from '$lib/components/ChatInput.svelte'; import ChatMessage from '$lib/components/ChatMessage.svelte'; import { useCurrentRoute } from '$lib/context'; - import { - Channel, - LastReadList, - Message, - MyAppAccount, - Reaction, - Space, - Thread, - Timeline - } from '$lib/schema'; - import { createMessage, createThread, joinSpace, publicGroup } from '$lib/utils'; + import { Channel, LastReadList, Message, MyAppAccount, Space } from '$lib/schema'; + import { createMessage, createThread, joinSpace } from '$lib/utils'; import { Button, Heading, Input, Modal } from '@fuxui/base'; import { AccountCoState, CoState } from 'jazz-svelte'; - import { Account, co, CoRichText, Group, z, type Loaded } from 'jazz-tools'; + import { Account, type Loaded } from 'jazz-tools'; import { view } from '../../view.svelte'; import ChatMessageThread from '$lib/components/ChatMessageThread.svelte'; import TimelineView from '$lib/components/TimelineView.svelte'; - import { onMount } from 'svelte'; const route = useCurrentRoute(); @@ -28,10 +18,6 @@ let admin = $derived(new CoState(Account, space.current?.adminId)); - $inspect(space.current); - $inspect(admin.current); - $inspect(admin.current?.adminId); - // onMount(() => { // setInterval(() => { // // post a new random message @@ -83,18 +69,16 @@ } } - $inspect(admin?.current); - function handleSubmit() { - if(!admin?.current) { + if (!admin?.current) { console.error('no admin'); return; } let images: string[] = []; - if(postImages.length > 0) { - postImages.forEach(image => { + if (postImages.length > 0) { + postImages.forEach((image) => { images.push(image.id); }); } @@ -180,7 +164,6 @@ .map((a) => a.value) ); - // svelte-ignore state_referenced_locally let count = $state(timeline.length ?? 0); @@ -196,6 +179,10 @@ $inspect(timeline.length); +{#if admin?.current} +
+{/if} + {#if view.active === 'channel'}