Skip to content

Commit

Permalink
refactor: Fix chat issue #2909
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Oct 1, 2024
1 parent 68df662 commit a2f8342
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
3 changes: 1 addition & 2 deletions lib/chat_room/cubit/chat_room_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,7 @@ abstract class ChatRoomCubit extends Cubit<ChatRoomState> {

final List<String> invites = [];

if (profileCubit.state.model.walletType == WalletType.enterprise &&
helpCenterOptions.customChatSupport &&
if (helpCenterOptions.customChatSupport &&
helpCenterOptions.customChatSupportName != null) {
invites.add(helpCenterOptions.customChatSupportName!);
}
Expand Down
22 changes: 10 additions & 12 deletions lib/onboarding/helper_function/helper_function.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,18 @@ Future<void> generateAccount({
isFromOnboarding: true,
);

if (profileCubit.state.model.walletType == WalletType.enterprise) {
final helpCenterOptions =
profileCubit.state.model.profileSetting.helpCenterOptions;
final helpCenterOptions =
profileCubit.state.model.profileSetting.helpCenterOptions;

if (helpCenterOptions.customChatSupport &&
helpCenterOptions.customChatSupportName != null) {
await altmeChatSupportCubit.init();
}
if (helpCenterOptions.customChatSupport &&
helpCenterOptions.customChatSupportName != null) {
await altmeChatSupportCubit.init();
}

if (helpCenterOptions.customNotification != null &&
helpCenterOptions.customNotification! &&
helpCenterOptions.customNotificationRoom != null) {
await matrixNotificationCubit.init();
}
if (helpCenterOptions.customNotification != null &&
helpCenterOptions.customNotification! &&
helpCenterOptions.customNotificationRoom != null) {
await matrixNotificationCubit.init();
}

await homeCubit.emitHasWallet();
Expand Down
27 changes: 13 additions & 14 deletions lib/splash/cubit/splash_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,19 @@ class SplashCubit extends Cubit<SplashState> {

if (hasWallet) {
await homeCubit.emitHasWallet();
if (profileCubit.state.model.walletType == WalletType.enterprise) {
final helpCenterOptions =
profileCubit.state.model.profileSetting.helpCenterOptions;

if (helpCenterOptions.customChatSupport &&
helpCenterOptions.customChatSupportName != null) {
await altmeChatSupportCubit.init();
}

if (helpCenterOptions.customNotification != null &&
helpCenterOptions.customNotification! &&
helpCenterOptions.customNotificationRoom != null) {
await matrixNotificationCubit.init();
}

final helpCenterOptions =
profileCubit.state.model.profileSetting.helpCenterOptions;

if (helpCenterOptions.customChatSupport &&
helpCenterOptions.customChatSupportName != null) {
await altmeChatSupportCubit.init();
}

if (helpCenterOptions.customNotification != null &&
helpCenterOptions.customNotification! &&
helpCenterOptions.customNotificationRoom != null) {
await matrixNotificationCubit.init();
}

emit(state.copyWith(status: SplashStatus.routeToPassCode));
Expand Down

0 comments on commit a2f8342

Please sign in to comment.