Skip to content

Commit bcf5dc8

Browse files
authored
DEV-43425 (#95)
1 parent bf7b028 commit bcf5dc8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/app/pages/info/info_view_model.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,16 @@ class InfoViewModel extends PageViewModel<InfoState, InfoStateStatus> {
325325
}
326326

327327
Future<void> reverseDay() async {
328+
final oldClosed = state.closed;
329+
328330
emit(state.copyWith(status: InfoStateStatus.reverseInProgress));
329331

330332
try {
331333
await usersRepository.reverseDay();
332334
await locationsRepository.deleteLocations();
333335
emit(state.copyWith(
334336
status: InfoStateStatus.reverseSuccess,
335-
message: 'День успешно ${state.closed ? 'открыт' : 'закрыт'}'
337+
message: 'День успешно ${oldClosed ? 'открыт' : 'закрыт'}'
336338
));
337339
} on AppError catch(e) {
338340
emit(state.copyWith(status: InfoStateStatus.reverseFailure, message: e.message));

0 commit comments

Comments
 (0)