MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / useUpdateNotification

Function useUpdateNotification

src/hooks/useUpdateNotification.ts:16–33  ·  view source on GitHub ↗
(
  updatedVersion: string | null | undefined,
  initialVersion: string = MACRO.VERSION,
)

Source from the content-addressed store, hash-verified

14}
15
16export function useUpdateNotification(
17 updatedVersion: string | null | undefined,
18 initialVersion: string = MACRO.VERSION,
19): string | null {
20 const lastNotifiedRef = useRef<string | null>(getSemverPart(initialVersion))
21
22 const updatedSemver = updatedVersion ? getSemverPart(updatedVersion) : null
23 if (!updatedSemver) {
24 return null
25 }
26
27 if (updatedSemver !== lastNotifiedRef.current) {
28 lastNotifiedRef.current = updatedSemver
29 return updatedSemver
30 }
31
32 return null
33}

Callers 2

AutoUpdaterFunction · 0.85
NativeAutoUpdaterFunction · 0.85

Calls 1

getSemverPartFunction · 0.85

Tested by

no test coverage detected