MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / buildUpdateNoticeState

Function buildUpdateNoticeState

src/components/common/sidebar/updateNotice.ts:16–30  ·  view source on GitHub ↗
(options: {
  latestVersion: string | null | undefined
  currentVersion: string
  serverHasUpdate?: boolean
})

Source from the content-addressed store, hash-verified

14}
15
16export function buildUpdateNoticeState(options: {
17 latestVersion: string | null | undefined
18 currentVersion: string
19 serverHasUpdate?: boolean
20}): UpdateNoticeState {
21 const latestVersion = options.latestVersion || ''
22 return {
23 latestVersion,
24 currentVersion: options.currentVersion,
25 hasUpdate:
26 typeof options.serverHasUpdate === 'boolean'
27 ? options.serverHasUpdate
28 : Boolean(latestVersion && isNewerStableVersion(latestVersion, options.currentVersion)),
29 }
30}
31
32export function buildUpdateNoticeCacheEntry(
33 state: UpdateNoticeState | null,

Callers 1

Calls 1

isNewerStableVersionFunction · 0.90

Tested by

no test coverage detected