@aion0/forge 0.2.14 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app/api/version/route.ts
CHANGED
|
@@ -14,7 +14,7 @@ const CURRENT_VERSION = (() => {
|
|
|
14
14
|
|
|
15
15
|
// Cache npm version check for 1 hour
|
|
16
16
|
let cachedLatest: { version: string; checkedAt: number } | null = null;
|
|
17
|
-
const CACHE_TTL =
|
|
17
|
+
const CACHE_TTL = 10 * 60 * 1000; // 10 minutes
|
|
18
18
|
|
|
19
19
|
async function getLatestVersion(): Promise<string> {
|
|
20
20
|
if (cachedLatest && Date.now() - cachedLatest.checkedAt < CACHE_TTL) {
|
package/components/Dashboard.tsx
CHANGED
|
@@ -55,9 +55,12 @@ export default function Dashboard({ user }: { user: any }) {
|
|
|
55
55
|
const [upgradeResult, setUpgradeResult] = useState<string | null>(null);
|
|
56
56
|
const terminalRef = useRef<WebTerminalHandle>(null);
|
|
57
57
|
|
|
58
|
-
// Version check (
|
|
58
|
+
// Version check (on mount + every 10 min)
|
|
59
59
|
useEffect(() => {
|
|
60
|
-
fetch('/api/version').then(r => r.json()).then(setVersionInfo).catch(() => {});
|
|
60
|
+
const check = () => fetch('/api/version').then(r => r.json()).then(setVersionInfo).catch(() => {});
|
|
61
|
+
check();
|
|
62
|
+
const id = setInterval(check, 10 * 60 * 1000);
|
|
63
|
+
return () => clearInterval(id);
|
|
61
64
|
}, []);
|
|
62
65
|
|
|
63
66
|
// Heartbeat for online user tracking
|
package/package.json
CHANGED