diff --git a/.changeset/spotty-crabs-rhyme.md b/.changeset/spotty-crabs-rhyme.md new file mode 100644 index 0000000000000..44ef04dce50e8 --- /dev/null +++ b/.changeset/spotty-crabs-rhyme.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes an issue that prevents the Enable button from being displayed on some migrated apps diff --git a/apps/meteor/client/views/marketplace/hooks/useAppMenu.tsx b/apps/meteor/client/views/marketplace/hooks/useAppMenu.tsx index 2bdbb2fd4aec1..3ac7d8781e511 100644 --- a/apps/meteor/client/views/marketplace/hooks/useAppMenu.tsx +++ b/apps/meteor/client/views/marketplace/hooks/useAppMenu.tsx @@ -367,8 +367,14 @@ export const useAppMenu = (app: App, isAppDetailsPage: boolean) => { }, ]; - const isEnterpriseOrNot = (app.isEnterpriseOnly && isEnterpriseLicense) || !app.isEnterpriseOnly; - const isPossibleToEnableApp = app.installed && isAdminUser && !isAppEnabled && isEnterpriseOrNot; + const isPossibleToEnableApp = + app.installed && + isAdminUser && + !isAppEnabled && + // If the app is migrated, it can be enabled regardless of other validations + // If not, and the app isEnterpriseOnly, we need to check the workspace's license + (app.migrated || !app.isEnterpriseOnly || isEnterpriseLicense); + const doesItReachedTheLimit = !app.migrated && !appCountQuery?.data?.hasUnlimitedApps &&