mirror of
https://github.com/zadam/trilium.git
synced 2026-01-05 22:24:25 +01:00
fix: toggling right pane visibility incorrectly affects all windows
This commit is contained in:
parent
4be3011a8a
commit
644d3a181f
@ -10,7 +10,7 @@ export default function RightPaneToggle() {
|
|||||||
const [ rightPaneVisible, setRightPaneVisible ] = useState(options.is("rightPaneVisible"));
|
const [ rightPaneVisible, setRightPaneVisible ] = useState(options.is("rightPaneVisible"));
|
||||||
|
|
||||||
useTriliumEvent("toggleRightPane", () => {
|
useTriliumEvent("toggleRightPane", () => {
|
||||||
setRightPaneVisible(!rightPaneVisible);
|
setRightPaneVisible(current => !current);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -31,8 +31,11 @@ export default function RightPanelContainer({ widgetsByParent }: { widgetsByPare
|
|||||||
const items = useItems(rightPaneVisible, widgetsByParent);
|
const items = useItems(rightPaneVisible, widgetsByParent);
|
||||||
useSplit(rightPaneVisible);
|
useSplit(rightPaneVisible);
|
||||||
useTriliumEvent("toggleRightPane", () => {
|
useTriliumEvent("toggleRightPane", () => {
|
||||||
options.save("rightPaneVisible",(!rightPaneVisible).toString());
|
setRightPaneVisible(current => {
|
||||||
setRightPaneVisible(!rightPaneVisible);
|
const newValue = !current;
|
||||||
|
options.save("rightPaneVisible", newValue.toString());
|
||||||
|
return newValue;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user