fix(layout): don't dismiss notebook on navigate to annotations when notebook is pinned, closes #3923 (#3948)

This commit is contained in:
Huang Xin
2026-04-24 23:42:17 +08:00
committed by GitHub
parent 71371130e0
commit 528a13e36a
2 changed files with 4 additions and 6 deletions
@@ -68,9 +68,8 @@ const Notebook: React.FC = ({}) => {
);
const onNavigateEvent = async () => {
const pinButton = document.querySelector('.sidebar-pin-btn');
const isPinButtonHidden = !pinButton || window.getComputedStyle(pinButton).display === 'none';
if (isPinButtonHidden) {
const { isNotebookPinned } = useNotebookStore.getState();
if (!isNotebookPinned) {
setNotebookVisible(false);
}
};
@@ -63,9 +63,8 @@ const SideBar = ({}) => {
};
const onNavigateEvent = async () => {
const pinButton = document.querySelector('.sidebar-pin-btn');
const isPinButtonHidden = !pinButton || window.getComputedStyle(pinButton).display === 'none';
if (isPinButtonHidden) {
const { isSideBarPinned } = useSidebarStore.getState();
if (!isSideBarPinned) {
setSideBarVisible(false);
}
};