diff --git a/package.json b/package.json index e5efe2c..6cccfdf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "smartims", "private": true, - "version": "0.4.0.1", + "version": "0.4.0.0", "type": "module", "scripts": { "dev": "vite", diff --git a/server/package.json b/server/package.json index 8537666..b7fabc2 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "server", - "version": "0.4.0.1", + "version": "0.4.0.0", "description": "", "main": "index.js", "scripts": { diff --git a/server/routes/system.js b/server/routes/system.js index 2e8b4cb..5da1139 100644 --- a/server/routes/system.js +++ b/server/routes/system.js @@ -548,10 +548,11 @@ router.get('/version/remote', isAuthenticated, hasRole('admin'), async (req, res // Filter 1: History is ONLY versions <= current const history = allTags.filter(t => compare(t.version, currentVersion) <= 0); - // Filter 2: Latest is the absolute newest tag available (could be > current) const latestFromRemote = allTags[0] || null; const needsUpdate = latestFromRemote ? (compare(latestFromRemote.version, currentVersion) > 0) : false; + console.log(`[VersionCheck] Current: "${currentVersion}", LatestTag: "${latestFromRemote?.version}", NeedsUpdate: ${needsUpdate}`); + res.json({ current: currentVersion, latest: latestFromRemote ? `v${latestFromRemote.version}` : null, diff --git a/src/platform/pages/VersionPage.tsx b/src/platform/pages/VersionPage.tsx index d1b3ea7..4cb8a53 100644 --- a/src/platform/pages/VersionPage.tsx +++ b/src/platform/pages/VersionPage.tsx @@ -113,11 +113,11 @@ export function VersionPage() { }; // Source of truth for versioning comes from the API - const currentVersion = remoteInfo?.current || '0.4.0'; + const currentVersion = remoteInfo?.current || healthIcon?.version || '0.4.0.0'; const buildDate = '2026-01-25'; - // Check if update is needed based on API-supplied needsUpdate flag - const needsUpdate = remoteInfo?.needsUpdate || false; + // IMPORTANT: needsUpdate should be true if remote has a higher version than local + const needsUpdate = !!remoteInfo?.needsUpdate; return (
- νμ¬ λ²μ : v{currentVersion} β μ΅μ λ²μ : {remoteInfo?.latest} -
- {remoteInfo?.latestInfo && ( -[{remoteInfo.latestInfo.title}]
-+ νμ¬: v{currentVersion} β μ°¨κΈ°: {remoteInfo.latest} +