mirror of
https://github.com/zadam/trilium.git
synced 2026-01-06 06:34:25 +01:00
fix: toggling right pane visibility incorrectly affects all windows
This commit is contained in:
parent
5aa0a956dd
commit
4be3011a8a
@ -1,15 +1,13 @@
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
import { t } from "../../services/i18n";
|
import { t } from "../../services/i18n";
|
||||||
import ActionButton from "../react/ActionButton";
|
|
||||||
import { useTriliumOptionBool } from "../react/hooks";
|
|
||||||
import { useState } from "preact/hooks";
|
|
||||||
import appContext from "../../components/app_context";
|
|
||||||
import { useTriliumEvent } from "../react/hooks";
|
|
||||||
import options from "../../services/options";
|
import options from "../../services/options";
|
||||||
|
import ActionButton from "../react/ActionButton";
|
||||||
|
import { useState } from "preact/hooks";
|
||||||
|
import { useTriliumEvent } from "../react/hooks";
|
||||||
|
|
||||||
export default function RightPaneToggle() {
|
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(!rightPaneVisible);
|
||||||
|
|||||||
@ -27,7 +27,7 @@ interface RightPanelWidgetDefinition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function RightPanelContainer({ widgetsByParent }: { widgetsByParent: WidgetsByParent }) {
|
export default function RightPanelContainer({ widgetsByParent }: { widgetsByParent: WidgetsByParent }) {
|
||||||
const [rightPaneVisible, setRightPaneVisible] = useState(options.is("rightPaneVisible"));
|
const [ rightPaneVisible, setRightPaneVisible ] = useState(options.is("rightPaneVisible"));
|
||||||
const items = useItems(rightPaneVisible, widgetsByParent);
|
const items = useItems(rightPaneVisible, widgetsByParent);
|
||||||
useSplit(rightPaneVisible);
|
useSplit(rightPaneVisible);
|
||||||
useTriliumEvent("toggleRightPane", () => {
|
useTriliumEvent("toggleRightPane", () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user