diff --git a/apps/meteor/client/views/marketplace/AppInstallPage.js b/apps/meteor/client/views/marketplace/AppInstallPage.js index 276bca2a280a..896be9061912 100644 --- a/apps/meteor/client/views/marketplace/AppInstallPage.js +++ b/apps/meteor/client/views/marketplace/AppInstallPage.js @@ -36,7 +36,7 @@ function AppInstallPage() { } const router = useRoute(currentRouteName); - const upgradeRoute = useRoute('upgradeRoute'); + const upgradeRoute = useRoute('upgrade'); const context = useRouteParameter('context'); @@ -177,7 +177,8 @@ function AppInstallPage() { handleClose={cancelAction} handleConfirm={() => uploadFile(appFile, manifest)} handleEnableUnlimitedApps={() => { - upgradeRoute.push(); + upgradeRoute.push({ type: 'go-fully-featured-registered' }); + setModal(null); }} />, ); diff --git a/apps/meteor/client/views/marketplace/UnlimitedAppsUpsellModal.tsx b/apps/meteor/client/views/marketplace/UnlimitedAppsUpsellModal.tsx index 7cd666285ca3..a12dfb109c74 100644 --- a/apps/meteor/client/views/marketplace/UnlimitedAppsUpsellModal.tsx +++ b/apps/meteor/client/views/marketplace/UnlimitedAppsUpsellModal.tsx @@ -10,22 +10,19 @@ export type UnlimitedAppsUpsellModalProps = { const UnlimitedAppsUpsellModal = ({ onClose }: UnlimitedAppsUpsellModalProps) => { const t = useTranslation(); const cloudWorkspaceHadTrial = useSetting('Cloud_Workspace_Had_Trial') as boolean; - const urls = { - goFullyFeaturedRegistered: '/upgrade/go-fully-featured-registered', - talkToSales: 'https://go.rocket.chat/i/contact-sales', - }; + const talkToSales = 'https://go.rocket.chat/i/contact-sales'; - const adminRoute = useRoute('admin-index'); + const upgradeRoute = useRoute('upgrade'); const goFullyFeaturedRegistered = useCallback(() => { - adminRoute.push({ context: urls.goFullyFeaturedRegistered }); + upgradeRoute.push({ type: 'go-fully-featured-registered' }); onClose(); - }, [adminRoute, onClose, urls.goFullyFeaturedRegistered]); + }, [upgradeRoute, onClose]); const goToTalkSales = useCallback(() => { - window.open(urls.talkToSales, '_blank'); + window.open(talkToSales, '_blank'); onClose(); - }, [onClose, urls.talkToSales]); + }, [onClose, talkToSales]); return ( - + diff --git a/apps/meteor/client/views/marketplace/hooks/useAppInstallationHandler.tsx b/apps/meteor/client/views/marketplace/hooks/useAppInstallationHandler.tsx index 6b0f6fb325b9..040b1d395d26 100644 --- a/apps/meteor/client/views/marketplace/hooks/useAppInstallationHandler.tsx +++ b/apps/meteor/client/views/marketplace/hooks/useAppInstallationHandler.tsx @@ -23,7 +23,7 @@ export function useAppInstallationHandler({ app, action, isAppPurchased, onDismi const dispatchToastMessage = useToastMessageDispatch(); const setModal = useSetModal(); - const upgradeRoute = useRoute('upgradeRoute'); + const upgradeRoute = useRoute('upgrade'); const routeContext = String(useRouteParameter('context')); const context = isMarketplaceRouteContext(routeContext) ? routeContext : 'explore'; @@ -85,7 +85,7 @@ export function useAppInstallationHandler({ app, action, isAppPurchased, onDismi try { const data = await Apps.buildExternalAppRequest(app.id); - setModal(); + setModal(); } catch (error) { handleAPIError(error); } @@ -109,7 +109,8 @@ export function useAppInstallationHandler({ app, action, isAppPurchased, onDismi handleClose={closeModal} handleConfirm={acquireApp} handleEnableUnlimitedApps={() => { - upgradeRoute.push(); + upgradeRoute.push({ type: 'go-fully-featured-registered' }); + setModal(null); }} />, );