mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
feat: add thread visibility management using Jotai atoms in chat components
This commit is contained in:
parent
8e5a80fc19
commit
4e4ea6fba0
4 changed files with 76 additions and 37 deletions
|
|
@ -47,6 +47,14 @@ export const addingCommentToMessageIdAtom = atom(
|
|||
}
|
||||
);
|
||||
|
||||
// Setter atom for updating thread visibility
|
||||
export const setThreadVisibilityAtom = atom(
|
||||
null,
|
||||
(get, set, newVisibility: ChatVisibility) => {
|
||||
set(currentThreadAtom, { ...get(currentThreadAtom), visibility: newVisibility });
|
||||
}
|
||||
);
|
||||
|
||||
export const resetCurrentThreadAtom = atom(null, (_, set) => {
|
||||
set(currentThreadAtom, initialState);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue