feat: Persist label state after get all labels
This commit is contained in:
@@ -179,6 +179,7 @@ class LabelController extends BaseController with LabelContextMenuMixin {
|
||||
void handleSuccessViewState(Success success) {
|
||||
if (success is GetAllLabelSuccess) {
|
||||
labels.value = success.labels..sortByAlphabetically();
|
||||
setCurrentLabelState(success.newState);
|
||||
} else if (success is CreateNewLabelSuccess) {
|
||||
_handleCreateNewLabelSuccess(success);
|
||||
} else if (success is GetLabelSettingStateSuccess) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:tmail_ui_user/features/labels/domain/usecases/create_new_label_i
|
||||
import 'package:tmail_ui_user/features/labels/domain/usecases/edit_label_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/labels/domain/usecases/delete_a_label_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/labels/domain/usecases/get_all_label_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/labels/domain/usecases/get_label_changes_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_creator/domain/usecases/verify_name_interactor.dart';
|
||||
import 'package:tmail_ui_user/main/exceptions/remote_exception_thrower.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
@@ -37,6 +38,7 @@ class LabelInteractorBindings extends InteractorsBindings {
|
||||
Get.lazyPut(() => CreateNewLabelInteractor(Get.find<LabelRepository>()));
|
||||
Get.lazyPut(() => EditLabelInteractor(Get.find<LabelRepository>()));
|
||||
Get.lazyPut(() => DeleteALabelInteractor(Get.find<LabelRepository>()));
|
||||
Get.lazyPut(() => GetLabelChangesInteractor(Get.find<LabelRepository>()));
|
||||
Get.lazyPut(() => VerifyNameInteractor());
|
||||
}
|
||||
|
||||
|
||||
@@ -252,6 +252,7 @@ class LabelUtils {
|
||||
}) {
|
||||
final idsToRemove = {
|
||||
...destroyedIds,
|
||||
...created.map((label) => label.id),
|
||||
...updated.map((label) => label.id),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user