diff --git a/lib/chat_room/view/chat_room_view.dart b/lib/chat_room/view/chat_room_view.dart index 34eba381c..1080f8000 100644 --- a/lib/chat_room/view/chat_room_view.dart +++ b/lib/chat_room/view/chat_room_view.dart @@ -35,22 +35,7 @@ class _ChatRoomViewState extends State { (_) async { liveChatCubit = context.read(); - final displayChatSupport = context - .read() - .state - .model - .profileSetting - .helpCenterOptions - .displayChatSupport; - - final isEnterprise = - context.read().state.model.walletType == - WalletType.enterprise; - - if (displayChatSupport || isEnterprise) { - // for enterprise we are initialisation at start - await context.read().init(); - } + await context.read().init(); /// we are on same screen, it is considered as read context.read().hardCodeAllMessageAsRead(); diff --git a/lib/dashboard/drawer/help_center/help_center/view/help_center_menu.dart b/lib/dashboard/drawer/help_center/help_center/view/help_center_menu.dart index 956294a55..e42006f0b 100644 --- a/lib/dashboard/drawer/help_center/help_center/view/help_center_menu.dart +++ b/lib/dashboard/drawer/help_center/help_center/view/help_center_menu.dart @@ -57,6 +57,9 @@ class HelpCenterView extends StatelessWidget { customChatSupportName = helpCenterOptions.customChatSupportName!; } + final isEnterprise = context.read().state.model.walletType == + WalletType.enterprise; + return BasePage( backgroundColor: Theme.of(context).colorScheme.surface, useSafeArea: true, @@ -70,7 +73,7 @@ class HelpCenterView extends StatelessWidget { padding: EdgeInsets.zero, ), const DrawerLogo(), - if (helpCenterOptions.displayChatSupport) ...[ + if (helpCenterOptions.displayChatSupport && isEnterprise) ...[ DrawerItem( title: '${l10n.chatWith} $customChatSupportName', onTap: () { diff --git a/lib/dashboard/src/view/dashboard_page.dart b/lib/dashboard/src/view/dashboard_page.dart index 9e0bb9fac..004440c08 100644 --- a/lib/dashboard/src/view/dashboard_page.dart +++ b/lib/dashboard/src/view/dashboard_page.dart @@ -161,6 +161,10 @@ class _DashboardViewState extends State { .helpCenterOptions .displayChatSupport; + final isEnterprise = + context.read().state.model.walletType == + WalletType.enterprise; + return PopScope( canPop: false, onPopInvoked: (_) async { @@ -210,7 +214,7 @@ class _DashboardViewState extends State { const WertPage() else const SearchPage(), - if (displayChatSupport) + if (displayChatSupport && isEnterprise) const AltmeSupportChatPage() else Container(), @@ -248,7 +252,7 @@ class _DashboardViewState extends State { onTap: () => bottomTapped(2), isSelected: state.selectedIndex == 2, ), - if (displayChatSupport) ...[ + if (displayChatSupport && isEnterprise) ...[ StreamBuilder( initialData: context .read()