feat(web): hide sidebar new-version prompt for edition=cloud

Cloud instances are upgraded centrally by the operator, so surfacing a GitHub
'new version available' badge to tenants is misleading and actionable only by
the operator. Skip the release check entirely when edition=cloud.
This commit is contained in:
RockChinQ
2026-06-08 12:56:54 -04:00
parent 2142e7d735
commit 698d4c1c82
@@ -1674,24 +1674,31 @@ export default function HomeSidebar({
.catch(() => {}); .catch(() => {});
} }
getCloudServiceClientSync() // Cloud edition is updated centrally by the operator, so end users should
.getLangBotReleases() // not see a "new version available" prompt in the sidebar. Skip the GitHub
.then((releases) => { // release check entirely for edition=cloud.
if (releases && releases.length > 0) { if (systemInfo?.edition !== 'cloud') {
const latestStable = releases.find((r) => !r.prerelease && !r.draft); getCloudServiceClientSync()
const latest = latestStable || releases[0]; .getLangBotReleases()
setLatestRelease(latest); .then((releases) => {
if (releases && releases.length > 0) {
const latestStable = releases.find(
(r) => !r.prerelease && !r.draft,
);
const latest = latestStable || releases[0];
setLatestRelease(latest);
const currentVersion = systemInfo?.version; const currentVersion = systemInfo?.version;
if (currentVersion && latest.tag_name) { if (currentVersion && latest.tag_name) {
const isNewer = compareVersions(latest.tag_name, currentVersion); const isNewer = compareVersions(latest.tag_name, currentVersion);
setHasNewVersion(isNewer); setHasNewVersion(isNewer);
}
} }
} })
}) .catch((error) => {
.catch((error) => { console.error('Failed to fetch releases:', error);
console.error('Failed to fetch releases:', error); });
}); }
getCloudServiceClientSync() getCloudServiceClientSync()
.getGitHubRepoInfo() .getGitHubRepoInfo()