Recurring
This commit is contained in:
parent
48fabb0256
commit
7fc352981e
|
|
@ -6,6 +6,7 @@ import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
|||
import 'package:invoiceninja_flutter/redux/ui/ui_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/expense/edit/expense_edit.dart';
|
||||
import 'package:invoiceninja_flutter/ui/expense/edit/expense_edit_vm.dart';
|
||||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/dialogs/error_dialog.dart';
|
||||
|
|
@ -82,6 +83,8 @@ class RecurringExpenseEditVM extends AbstractExpenseEditVM {
|
|||
}
|
||||
},
|
||||
onSavePressed: (BuildContext context) {
|
||||
Debouncer.runOnComplete(() {
|
||||
final recurringExpense = store.state.recurringExpenseUIState.editing;
|
||||
final localization = AppLocalization.of(context);
|
||||
final Completer<ExpenseEntity> completer =
|
||||
new Completer<ExpenseEntity>();
|
||||
|
|
@ -92,8 +95,8 @@ class RecurringExpenseEditVM extends AbstractExpenseEditVM {
|
|||
? localization.createdRecurringExpense
|
||||
: localization.updatedRecurringExpense);
|
||||
if (state.prefState.isMobile) {
|
||||
store
|
||||
.dispatch(UpdateCurrentRoute(RecurringExpenseViewScreen.route));
|
||||
store.dispatch(
|
||||
UpdateCurrentRoute(RecurringExpenseViewScreen.route));
|
||||
if (recurringExpense.isNew) {
|
||||
Navigator.of(context)
|
||||
.pushReplacementNamed(RecurringExpenseViewScreen.route);
|
||||
|
|
@ -110,6 +113,7 @@ class RecurringExpenseEditVM extends AbstractExpenseEditVM {
|
|||
return ErrorDialog(error);
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
|||
import 'package:invoiceninja_flutter/redux/ui/ui_actions.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/dialogs/error_dialog.dart';
|
||||
import 'package:invoiceninja_flutter/ui/stub/view/stub_view_vm.dart';
|
||||
|
|
@ -72,6 +73,8 @@ class StubEditVM {
|
|||
}
|
||||
},
|
||||
onSavePressed: (BuildContext context) {
|
||||
Debouncer.runOnComplete(() {
|
||||
final stub = store.state.stubUIState.editing;
|
||||
final localization = AppLocalization.of(context);
|
||||
final Completer<StubEntity> completer = new Completer<StubEntity>();
|
||||
store.dispatch(SaveStubRequest(completer: completer, stub: stub));
|
||||
|
|
@ -96,6 +99,7 @@ class StubEditVM {
|
|||
return ErrorDialog(error);
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue