MCPcopy
hub / github.com/ZToolsCenter/ZTools / removeFromHistory

Method removeFromHistory

src/main/api/renderer/commands.ts:888–902  ·  view source on GitHub ↗

* 从历史记录中删除

(appPath: string, featureCode?: string, name?: string)

Source from the content-addressed store, hash-verified

886 * 从历史记录中删除
887 */
888 private removeFromHistory(appPath: string, featureCode?: string, name?: string): void {
889 try {
890 const originalHistory: any[] = databaseAPI.dbGet('command-history') || []
891
892 const history = filterOutCommand(originalHistory, appPath, featureCode, name)
893
894 databaseAPI.dbPut('command-history', history)
895 console.log('[Commands] 已从历史记录删除:', appPath, featureCode)
896
897 // 通知前端重新加载历史记录
898 this.notifyRenderer('history-changed')
899 } catch (error) {
900 console.error('[Commands] 从历史记录删除失败:', error)
901 }
902 }
903
904 /**
905 * 固定应用

Callers 3

setupIPCMethod · 0.95
launchMethod · 0.95
removeFromHistoryFunction · 0.80

Calls 4

notifyRendererMethod · 0.95
filterOutCommandFunction · 0.90
dbGetMethod · 0.45
dbPutMethod · 0.45

Tested by

no test coverage detected