Open History to see the last commit
1import type { ScopedThreadRef } from "@t3tools/contracts";
2import { Atom } from "effect/reactivity";
3
4import { appAtomRegistry } from "~/rpc/atomRegistry";
5
6/**
7 * Which thread has the guest share dialog open. The thread menu and the command palette both
8 * close as their command runs, so the chat view renders the dialog once.
9 */
10export const guestShareDialogThreadAtom = Atom.make<ScopedThreadRef | null>(null).pipe(
11 Atom.keepAlive,
12 Atom.withLabel("guest-share:dialog-thread"),
13);
14
15export function openGuestShareDialog(threadRef: ScopedThreadRef): void {
16 appAtomRegistry.set(guestShareDialogThreadAtom, threadRef);
17}