MCPcopy Create free account
hub / github.com/experdot/pointer / deletePages

Function deletePages

src/renderer/src/services/pagesService.ts:157–176  ·  view source on GitHub ↗
(ids: string[])

Source from the content-addressed store, hash-verified

155
156// 批量删除页面
157export async function deletePages(ids: string[]): Promise<void> {
158 if (ids.length === 0) return
159
160 const { page, message, tab } = stores
161
162 // 清除消息缓存
163 for (const id of ids) {
164 message.evict(id)
165 await useMessageQueueStore.getState().removeRecord(id)
166 }
167
168 // 关闭对应的标签页
169 const tabsToClose = tab.tabs.filter((t) => t.dataId && ids.includes(t.dataId))
170 for (const existingTab of tabsToClose) {
171 tab.closeTab(existingTab.id)
172 }
173
174 // 批量删除页面
175 await page.deleteMany(ids)
176}
177
178// 检查页面在目标文件夹是否重名
179export function checkPageNameConflict(

Callers 1

handleBatchDeleteFunction · 0.85

Calls 4

evictMethod · 0.80
removeRecordMethod · 0.80
closeTabMethod · 0.80
deleteManyMethod · 0.80

Tested by

no test coverage detected