mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-30 16:50:47 +08:00
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:
@@ -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(() => {
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user