Skip to content

Commit 7d83291

Browse files
committed
https://github.com/siyuan-note/siyuan/pull/17675#discussion_r3441865530
1 parent dc60b43 commit 7d83291

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

app/src/layout/util.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ export const setPanelFocus = (element: Element, isSaveLayout = true) => {
6969
export const getWndByLayout: (layout: Layout) => Wnd = (layout: Layout) => {
7070
const wndsTemp: Wnd[] = [];
7171
getAllWnds(layout, wndsTemp);
72-
const sorted = wndsTemp.sort((a, b) => {
72+
return wndsTemp.sort((a, b) => {
7373
if (a.element.querySelector(".fn__flex .item--focus")?.getAttribute("data-activetime") > b.element.querySelector(".fn__flex .item--focus")?.getAttribute("data-activetime")) {
7474
return -1;
7575
}
76-
});
77-
return (sorted[0] ?? null) as unknown as Wnd;
76+
})[0];
7877
};
7978

8079
const dockToJSON = (dock: Dock) => {

0 commit comments

Comments
 (0)