File tree Expand file tree Collapse file tree
src/apps/user/messages/Messages/Container Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
2- import { Daemon } from " $ts/server/user/daemon" ;
32 import type { ExpandedMessageNode } from " $types/messaging" ;
43 import { onMount } from " svelte" ;
54 import SvelteMarkdown from " svelte-markdown" ;
65 import type { MessagingAppRuntime } from " ../../runtime" ;
76 import Header from " ./MessageContent/Header.svelte" ;
87 import MessageThread from " ./MessageThread.svelte" ;
8+ import Spinner from " $lib/Spinner.svelte" ;
99
1010 const { process }: { process: MessagingAppRuntime } = $props ();
1111 const { message } = process ;
12- const userId = Daemon ! .userInfo ! ._id ;
1312
1413 let expandThread = $state <boolean >(false );
14+ let loadingThread = $state <boolean >(false );
1515 let thread = $state <ExpandedMessageNode []>();
1616
1717 onMount (async () => {
1818 if (! $message ) return ;
1919
20+ loadingThread = true ;
2021 thread = await process .service .getMessageThread ($message ?._id ! );
22+ loadingThread = false ;
2123 });
2224 </script >
2325
2729 <div class =" message-body markdown-body" >
2830 <SvelteMarkdown source ={$message .body } />
2931 </div >
32+ {#if loadingThread }
33+ <div class =" thread-wrapper" >
34+ <div class =" notice" >
35+ <p >Loading thread information...</p >
36+ <Spinner height ={30 } />
37+ </div >
38+ </div >
39+ {/if }
3040 {#if $message .repliesTo && thread ?.length }
3141 <div class ="thread-wrapper" class:expand ={expandThread }>
3242 <div class =" notice" >
Original file line number Diff line number Diff line change 1616 </script >
1717
1818<div class =" message-thread" >
19- <button class =" thread-item" >
19+ <button class ="thread-item" onclick ={() => process . readMessage ( message . _id , true )} >
2020 <Header {process } {message }></Header >
2121 <p >{message .body }</p >
2222 </button >
You can’t perform that action at this time.
0 commit comments