| 1067 | }, |
| 1068 | |
| 1069 | beginCloseConfirmation(kind, tabIds = []) { |
| 1070 | const ids = tabIds.filter(Boolean); |
| 1071 | const tabs = ids.map((id) => this.tabs.find((tab) => tab.tab_id === id)).filter(Boolean); |
| 1072 | const dirtyCount = tabs.filter((tab) => this.isTabDirty(tab)).length; |
| 1073 | this.pendingClose = { |
| 1074 | kind, |
| 1075 | tabId: kind === "single" ? ids[0] || "" : "", |
| 1076 | tabIds: ids, |
| 1077 | totalCount: tabs.length, |
| 1078 | dirtyCount, |
| 1079 | }; |
| 1080 | if (kind === "single" && ids[0] && this.activeTabId !== ids[0]) { |
| 1081 | this.selectTab(ids[0], { focus: false }); |
| 1082 | } |
| 1083 | }, |
| 1084 | |
| 1085 | cancelPendingClose() { |
| 1086 | this.pendingClose = null; |