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

Function openPage

src/renderer/src/services/pagesService.ts:405–428  ·  view source on GitHub ↗
(pageId: string, preview = false)

Source from the content-addressed store, hash-verified

403
404// 打开页面(在标签页中)
405export async function openPage(pageId: string, preview = false): Promise<void> {
406 const { page, message, tab } = stores
407 const existingPage = page.getById(pageId)
408 if (!existingPage) return
409
410 // 预加载消息
411 await message.load(pageId)
412
413 const existingTab = tab.tabs.find((t) => t.dataId === pageId)
414
415 if (existingTab) {
416 tab.openTab(existingTab, preview)
417 } else {
418 tab.openTab(
419 {
420 id: uuidv4(),
421 type: 'chat',
422 title: existingPage.name,
423 dataId: pageId
424 },
425 preview
426 )
427 }
428}
429
430// 获取文件夹下的页面
431export function getPagesInFolder(folderId: string | undefined): PageRecord[] {

Callers 5

handleEditFunction · 0.85
handleSelectFunction · 0.85
handleDoubleClickFunction · 0.85
handleCreatePageFunction · 0.85
handleCreatePageInFolderFunction · 0.85

Calls 3

loadMethod · 0.80
openTabMethod · 0.80
getByIdMethod · 0.65

Tested by

no test coverage detected