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

Function computeNewHistory

src/renderer/src/stores/tabsStore.ts:71–84  ·  view source on GitHub ↗
(
  history: TabHistoryEntry[],
  historyIndex: number,
  tab: Tab
)

Source from the content-addressed store, hash-verified

69}
70
71function computeNewHistory(
72 history: TabHistoryEntry[],
73 historyIndex: number,
74 tab: Tab
75): { history: TabHistoryEntry[]; historyIndex: number } {
76 if (isNavigating) {
77 return { history, historyIndex }
78 }
79 if (history[historyIndex]?.tabId === tab.id) {
80 return { history, historyIndex }
81 }
82 const newHistory = [...history.slice(0, historyIndex + 1), toHistoryEntry(tab)]
83 return { history: newHistory, historyIndex: newHistory.length - 1 }
84}
85
86function tryNavigateToHistory(
87 history: TabHistoryEntry[],

Callers 1

tabsStore.tsFile · 0.85

Calls 1

toHistoryEntryFunction · 0.85

Tested by

no test coverage detected