Keep the open thread on screen while reconnecting
The session resubscribes threads itself after a reconnect; App no longer drops the subscription, so the thread doesn't blank to loading.
This commit is contained in:
1 parent
2c5eedc869
commit
320dbf492d
1 file changed
+3
-2
+3
-2
@@ -220,9 +220,10 @@ export function App(props: { readonly session: T3Session; readonly config: Tui3C
|
||||
const [thread, setThread] = useState<ThreadState | null>(null);
|
||||
useEffect(() => {
|
||||
setThread(null);
|
||||
if (!watchedId || shell.status.type !== "live") return;
|
||||
if (!watchedId) return;
|
||||
// The session resubscribes after a reconnect; meanwhile the thread stays on screen.
|
||||
return session.watchThread(watchedId, setThread);
|
||||
}, [session, watchedId, shell.status.type]);
|
||||
}, [session, watchedId]);
|
||||
|
||||
const unread = threadRow?.unread === true;
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user