From 0af7b8b14516bef2880420b76d728883db17cf07 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Mon, 29 Dec 2025 15:56:04 +0800 Subject: [PATCH] chore(window): use MAX_SAVED_WINDOWS constant --- apps/client/src/components/tab_manager.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/client/src/components/tab_manager.ts b/apps/client/src/components/tab_manager.ts index 6d48a80bb..b57d23983 100644 --- a/apps/client/src/components/tab_manager.ts +++ b/apps/client/src/components/tab_manager.ts @@ -11,6 +11,8 @@ import linkService from "../services/link.js"; import type { EventData } from "./app_context.js"; import type FNote from "../entities/fnote.js"; +const MAX_SAVED_WINDOWS = 10; + interface TabState { contexts: NoteContext[]; position: number; @@ -140,7 +142,7 @@ export default class TabManager extends Component { currentWin.contexts = filteredNoteContexts; } else { // Filter out the oldest entry (excluding the main window) - if (savedWindows?.length >= 10) { + if (savedWindows?.length >= MAX_SAVED_WINDOWS) { const candidates = savedWindows.filter(w => w.windowId !== "main"); const oldest = candidates.reduce((a, b) => a.createdAt < b.createdAt ? a : b