Skip to content

Commit

Permalink
TF-2302 Fix show folder
Browse files Browse the repository at this point in the history
Signed-off-by: dab246 <[email protected]>
  • Loading branch information
dab246 committed Nov 7, 2023
1 parent d252adf commit 503ccd1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 11 deletions.
15 changes: 12 additions & 3 deletions lib/features/mailbox/presentation/mailbox_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,10 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
}
}

_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
_refreshMailboxChanges(
currentMailboxState: success.currentMailboxState,
properties: MailboxConstants.propertiesDefault
);
}

void _handleUnsubscribeMultipleMailboxAllSuccess(SubscribeMultipleMailboxAllSuccess success) {
Expand All @@ -1104,7 +1107,10 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
}
}

_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
_refreshMailboxChanges(
currentMailboxState: success.currentMailboxState,
properties: MailboxConstants.propertiesDefault
);
}

void _handleUnsubscribeMultipleMailboxHasSomeSuccess(SubscribeMultipleMailboxHasSomeSuccess success) {
Expand All @@ -1120,7 +1126,10 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
}
}

_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
_refreshMailboxChanges(
currentMailboxState: success.currentMailboxState,
properties: MailboxConstants.propertiesDefault
);
}

void _closeEmailViewIfMailboxDisabledOrNotExist(List<MailboxId> mailboxIdsDisabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import 'package:dartz/dartz.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:jmap_dart_client/jmap/core/properties/properties.dart';
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
import 'package:model/extensions/presentation_mailbox_extension.dart';
import 'package:model/mailbox/expand_mode.dart';
import 'package:model/mailbox/presentation_mailbox.dart';
import 'package:tmail_ui_user/features/base/base_mailbox_controller.dart';
import 'package:tmail_ui_user/features/mailbox/domain/constants/mailbox_constants.dart';
import 'package:tmail_ui_user/features/mailbox/domain/model/mailbox_subscribe_action_state.dart';
import 'package:tmail_ui_user/features/mailbox/domain/model/mailbox_subscribe_state.dart';
import 'package:tmail_ui_user/features/mailbox/domain/model/subscribe_mailbox_request.dart';
Expand Down Expand Up @@ -166,7 +168,10 @@ class MailboxVisibilityController extends BaseMailboxController {
_showToastSubscribeMailboxSuccess(subscribeMailboxSuccess.mailboxId);
}

_refreshMailboxChanges(subscribeMailboxSuccess.currentMailboxState);
_refreshMailboxChanges(
newMailboxState: subscribeMailboxSuccess.currentMailboxState,
properties: MailboxConstants.propertiesDefault
);
}

void _handleUnsubscribeMultipleMailboxHasSomeSuccess(SubscribeMultipleMailboxHasSomeSuccess subscribeMailboxSuccess) {
Expand All @@ -177,7 +182,10 @@ class MailboxVisibilityController extends BaseMailboxController {
);
}

_refreshMailboxChanges(subscribeMailboxSuccess.currentMailboxState);
_refreshMailboxChanges(
newMailboxState: subscribeMailboxSuccess.currentMailboxState,
properties: MailboxConstants.propertiesDefault
);
}

void _handleUnsubscribeMultipleMailboxAllSuccess(SubscribeMultipleMailboxAllSuccess subscribeMailboxSuccess) {
Expand All @@ -188,15 +196,23 @@ class MailboxVisibilityController extends BaseMailboxController {
);
}

_refreshMailboxChanges(subscribeMailboxSuccess.currentMailboxState);
_refreshMailboxChanges(
newMailboxState: subscribeMailboxSuccess.currentMailboxState,
properties: MailboxConstants.propertiesDefault
);
}

void _refreshMailboxChanges(jmap.State? newMailboxState) {
void _refreshMailboxChanges({jmap.State? newMailboxState, Properties? properties}) {
final session = _accountDashBoardController.sessionCurrent;
final accountId = _accountDashBoardController.accountId.value;
final mailboxState = newMailboxState ?? currentMailboxState;
if (session != null && accountId != null && mailboxState != null) {
refreshMailboxChanges(session, accountId, mailboxState);
refreshMailboxChanges(
session,
accountId,
mailboxState,
properties: properties
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,10 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
}
}

_refreshMailboxChanges(mailboxState: success.currentMailboxState);
_refreshMailboxChanges(
mailboxState: success.currentMailboxState,
properties: MailboxConstants.propertiesDefault
);
}

void _handleSubscribeMultipleMailboxAllSuccess(SubscribeMultipleMailboxAllSuccess success) {
Expand All @@ -527,7 +530,10 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
}
}

_refreshMailboxChanges(mailboxState: success.currentMailboxState);
_refreshMailboxChanges(
mailboxState: success.currentMailboxState,
properties: MailboxConstants.propertiesDefault
);
}

void _handleSubscribeMultipleMailboxHasSomeSuccess(SubscribeMultipleMailboxHasSomeSuccess success) {
Expand All @@ -545,7 +551,10 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
}
}

_refreshMailboxChanges(mailboxState: success.currentMailboxState);
_refreshMailboxChanges(
mailboxState: success.currentMailboxState,
properties: MailboxConstants.propertiesDefault
);
}

void _showToastSubscribeMailboxSuccess(
Expand Down

0 comments on commit 503ccd1

Please sign in to comment.