mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 01:36:30 +02:00
feat: integrate documentsSidebarOpenAtom with report panel state management to improve UI interactions
This commit is contained in:
parent
5ea13e827b
commit
9d37b66f2f
1 changed files with 7 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { atom } from "jotai";
|
||||
import { documentsSidebarOpenAtom } from "@/atoms/documents/ui.atoms";
|
||||
|
||||
interface ReportPanelState {
|
||||
isOpen: boolean;
|
||||
|
|
@ -43,10 +44,15 @@ export const openReportPanelAtom = atom(
|
|||
wordCount: wordCount ?? null,
|
||||
shareToken: shareToken ?? null,
|
||||
});
|
||||
set(documentsSidebarOpenAtom, false);
|
||||
}
|
||||
);
|
||||
|
||||
/** Action atom to close the report panel */
|
||||
export const closeReportPanelAtom = atom(null, (_, set) => {
|
||||
export const closeReportPanelAtom = atom(null, (get, set) => {
|
||||
const wasOpen = get(reportPanelAtom).isOpen;
|
||||
set(reportPanelAtom, initialState);
|
||||
if (wasOpen) {
|
||||
set(documentsSidebarOpenAtom, true);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue