diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/sites/domain/domain_item.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/sites/domain/domain_item.dart index 07830576e36e..e984854ee79a 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/sites/domain/domain_item.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/sites/domain/domain_item.dart @@ -215,6 +215,13 @@ class _FreePlanUpgradeButton extends StatelessWidget { @override Widget build(BuildContext context) { + final isOwner = context + .watch() + .state + .currentWorkspaceMember + ?.role + .isOwner ?? + false; return Container( alignment: Alignment.centerLeft, child: FlowyTooltip( @@ -233,16 +240,26 @@ class _FreePlanUpgradeButton extends StatelessWidget { ), hoverColor: context.proSecondaryColor.withOpacity(0.9), onTap: () { - showToastNotification( - context, - message: - LocaleKeys.settings_sites_namespace_redirectToPayment.tr(), - type: ToastificationType.info, - ); + if (isOwner) { + showToastNotification( + context, + message: + LocaleKeys.settings_sites_namespace_redirectToPayment.tr(), + type: ToastificationType.info, + ); - context.read().add( - const SettingsSitesEvent.upgradeSubscription(), - ); + context.read().add( + const SettingsSitesEvent.upgradeSubscription(), + ); + } else { + showToastNotification( + context, + message: LocaleKeys + .settings_sites_namespace_pleaseAskOwnerToSetHomePage + .tr(), + type: ToastificationType.info, + ); + } }, ), ), diff --git a/frontend/resources/translations/en.json b/frontend/resources/translations/en.json index 4131af6e321e..ac3f918a415f 100644 --- a/frontend/resources/translations/en.json +++ b/frontend/resources/translations/en.json @@ -452,7 +452,8 @@ "updateExistingNamespace": "Update existing namespace", "upgradeToPro": "Upgrade to Pro Plan to set a homepage", "redirectToPayment": "Redirecting to payment page...", - "onlyWorkspaceOwnerCanSetHomePage": "Only the workspace owner can set a homepage" + "onlyWorkspaceOwnerCanSetHomePage": "Only the workspace owner can set a homepage", + "pleaseAskOwnerToSetHomePage": "Please ask the workspace owner to upgrade to Pro Plan" }, "publishedPage": { "title": "All published pages",