Skip to content

Commit 2fd628b

Browse files
committed
fix(marketplace): detail CTA reflects installed state on tenant runtimes
The package-detail primary CTA stayed 'Install to cloud…' even for an already-installed package in an env console. The installed-state probe was gated on getRuntimeConfig().defaultEnvironmentId, which is empty on a per-subdomain tenant runtime — so the probe never ran. But getCloudInstallationInfo's same-origin /cloud-connection/installation path resolves the env by hostname and needs no explicit id (pairs with cloud #88). Drop the guard so the probe always runs; the CTA flips to 'Installed'. Also add the missing marketplace.action.installed i18n key (en 'Installed', zh '已安装') — code previously relied on a defaultValue fallback, so zh showed English.
1 parent 2f31406 commit 2fd628b

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

‎packages/app-shell/src/console/marketplace/MarketplacePackagePage.tsx‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,18 @@ export function MarketplacePackagePage() {
112112
return () => { cancelled = true; };
113113
}, [packageId, localResult]);
114114

115-
// Seed cloud-install state: when the runtime advertises a default
116-
// environment (per-subdomain ObjectOS), check whether this package is
117-
// already installed in that env so the primary CTA renders as
118-
// "Installed" on first paint instead of inviting another install.
115+
// Seed cloud-install state so the primary CTA renders as "Installed" on
116+
// first paint instead of inviting another install.
117+
// NOTE: a tenant runtime (per-subdomain ObjectOS) has NO
118+
// `defaultEnvironmentId` — but getCloudInstallationInfo's same-origin
119+
// `/cloud-connection/installation` path resolves the env by hostname and
120+
// does not need an explicit id (only the cloud-control-plane path needs
121+
// one, and it no-ops on an empty id internally). So do NOT gate the probe
122+
// on `currentEnvId` — that left the detail CTA stuck on "Install to
123+
// cloud…" for every already-installed package in an env console.
119124
useEffect(() => {
120125
if (!packageId) return;
121-
const currentEnvId = getRuntimeConfig().defaultEnvironmentId;
122-
if (!currentEnvId) return;
126+
const currentEnvId = getRuntimeConfig().defaultEnvironmentId ?? '';
123127
let cancelled = false;
124128
(async () => {
125129
const info = await getCloudInstallationInfo(packageId, currentEnvId);

‎packages/i18n/src/locales/en.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,6 +1705,7 @@ const en = {
17051705
reinstall: 'Reinstall',
17061706
working: 'Working…',
17071707
installToCloud: 'Install to cloud…',
1708+
installed: 'Installed',
17081709
installing: 'Installing…',
17091710
uninstall: 'Uninstall',
17101711
uninstalling: 'Uninstalling…',

‎packages/i18n/src/locales/zh.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,6 +1699,7 @@ const zh = {
16991699
reinstall: '重新安装',
17001700
working: '处理中…',
17011701
installToCloud: '安装到云端…',
1702+
installed: '已安装',
17021703
installing: '安装中…',
17031704
uninstall: '卸载',
17041705
uninstalling: '卸载中…',

0 commit comments

Comments
 (0)