diff --git a/src/index.ts b/src/index.ts index 043babc..0e2c4f8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -116,9 +116,10 @@ function renderMenu(menuList: MenuItem[]): void { * 添加标签页 * @param tabGroup 标签组 * @param menuItem 菜单项 + * @param allowCloseTab 是否允许关闭标签页 * @returns 标签页 */ -async function addTabAsync(tabGroup: TabGroup, menuItem: MenuItem): Promise { +async function addTabAsync(tabGroup: TabGroup, menuItem: MenuItem, allowCloseTab: boolean = true): Promise { const url: string = menuItem.Url.startsWith("http") ? menuItem.Url : `http://${menuItem.Url}`; const result: { ok: boolean; status: number; message?: string } = await window.electronAPI.checkUrlAvailable(url); if (result.ok && result.status >= 200 && result.status < 400) { @@ -140,7 +141,7 @@ async function addTabAsync(tabGroup: TabGroup, menuItem: MenuItem): Promise { // Create initial tab const firstMenuItem: MenuItem = menuList[0]; - await addTabAsync(tabGroup, firstMenuItem); + await addTabAsync(tabGroup, firstMenuItem, false); // Bind help icon click event const helpMenuItem: MenuItem = menuList[menuList.length - 2];