π File detail
services/tips/tipHistory.ts
π§© .tsπ 18 linesπΎ 601 bytesπ text
β Back to All Filesπ― Use case
This file lives under βservices/β, which covers long-lived services (LSP, MCP, OAuth, tool execution, memory, compaction, voice, settings sync, β¦). On the API surface it exposes recordTipShown and getSessionsSinceLastShown β mainly functions, hooks, or classes. It composes internal code from utils (relative imports).
Generated from folder role, exports, dependency roots, and inline comments β not hand-reviewed for every path.
π§ Inline summary
import { getGlobalConfig, saveGlobalConfig } from '../../utils/config.js' export function recordTipShown(tipId: string): void { const numStartups = getGlobalConfig().numStartups saveGlobalConfig(c => {
π€ Exports (heuristic)
recordTipShowngetSessionsSinceLastShown
π₯οΈ Source preview
import { getGlobalConfig, saveGlobalConfig } from '../../utils/config.js'
export function recordTipShown(tipId: string): void {
const numStartups = getGlobalConfig().numStartups
saveGlobalConfig(c => {
const history = c.tipsHistory ?? {}
if (history[tipId] === numStartups) return c
return { ...c, tipsHistory: { ...history, [tipId]: numStartups } }
})
}
export function getSessionsSinceLastShown(tipId: string): number {
const config = getGlobalConfig()
const lastShown = config.tipsHistory?.[tipId]
if (!lastShown) return Infinity
return config.numStartups - lastShown
}