Show "Up to date" only after a successful check

The settings footer showed "Up to date" whenever no new version was
known — including when the update checker was disabled or the version
fetch had silently failed. Derive an explicit upToDate state that is
only true when a check succeeded and found no newer version, so a
failed or disabled check no longer claims the app is current.
This commit is contained in:
Rūdolfs Ošiņš
2026-06-10 16:03:38 +02:00
parent b363fdb297
commit f922e9415c
2 changed files with 19 additions and 1 deletions
+18
View File
@@ -41,6 +41,24 @@ class UpdateChecker {
}
});
// True only when a version check has succeeded and found no newer
// version. Stays false when the checker is disabled or the check failed,
// so the UI doesn't claim "up to date" without evidence.
public upToDate = $derived.by(() => {
if (
this.isEnabled &&
this.latestVersionInfo &&
this.sanitizedCurrentVersion
) {
return !semver.gt(
this.latestVersionInfo.version,
this.sanitizedCurrentVersion,
);
} else {
return false;
}
});
// A state that holds the `LatestVersionInfo` if this feature has
// been enabled and if there is a newer version available.
public newVersion = $derived.by(() => {
+1 -1
View File
@@ -140,7 +140,7 @@
· <ExternalLink href="https://radicle.dev/desktop">
Update to {updateChecker.newVersion}
</ExternalLink>
{:else}
{:else if updateChecker.upToDate}
· Up to date
{/if}
{/if}