mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
18 lines
477 B
TypeScript
18 lines
477 B
TypeScript
import { useEffect, useRef } from 'react'
|
|
import { touchRepoActivity } from '@/api/repos'
|
|
|
|
export function useRepoActivity(repoId: number, isReady: boolean): void {
|
|
const hasLoggedRef = useRef(false)
|
|
|
|
useEffect(() => {
|
|
if (!isReady || hasLoggedRef.current || !repoId) {
|
|
return
|
|
}
|
|
|
|
hasLoggedRef.current = true
|
|
|
|
touchRepoActivity(repoId).catch(() => {
|
|
// Silent failure - activity tracking must not block navigation
|
|
})
|
|
}, [repoId, isReady])
|
|
} |