1 parent dc60b43 commit 7d83291Copy full SHA for 7d83291
1 file changed
app/src/layout/util.ts
@@ -69,12 +69,11 @@ export const setPanelFocus = (element: Element, isSaveLayout = true) => {
69
export const getWndByLayout: (layout: Layout) => Wnd = (layout: Layout) => {
70
const wndsTemp: Wnd[] = [];
71
getAllWnds(layout, wndsTemp);
72
- const sorted = wndsTemp.sort((a, b) => {
+ return wndsTemp.sort((a, b) => {
73
if (a.element.querySelector(".fn__flex .item--focus")?.getAttribute("data-activetime") > b.element.querySelector(".fn__flex .item--focus")?.getAttribute("data-activetime")) {
74
return -1;
75
}
76
- });
77
- return (sorted[0] ?? null) as unknown as Wnd;
+ })[0];
78
};
79
80
const dockToJSON = (dock: Dock) => {
0 commit comments