MCPcopy
hub / github.com/codeaashu/claude-code / useUpdateNotification

Function useUpdateNotification

src/hooks/useUpdateNotification.ts:16–34  ·  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 [lastNotifiedSemver, setLastNotifiedSemver] = useState<string | null>(
21 () => getSemverPart(initialVersion),
22 )
23
24 if (!updatedVersion) {
25 return null
26 }
27
28 const updatedSemver = getSemverPart(updatedVersion)
29 if (updatedSemver !== lastNotifiedSemver) {
30 setLastNotifiedSemver(updatedSemver)
31 return updatedSemver
32 }
33 return null
34}
35

Callers 2

AutoUpdaterFunction · 0.85
NativeAutoUpdaterFunction · 0.85

Calls 1

getSemverPartFunction · 0.85

Tested by

no test coverage detected