Fix for app context
This commit is contained in:
parent
354b0bcf4f
commit
d3f7b76540
|
|
@ -111,7 +111,7 @@ class ClientEditVM {
|
|||
showToast(client.isNew
|
||||
? localization.createdClient
|
||||
: localization.updatedClient);
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(ClientViewScreen.route));
|
||||
if (client.isNew && state.clientUIState.saveCompleter == null) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class CompanyGatewayEditVM {
|
|||
? localization.createdCompanyGateway
|
||||
: localization.updatedCompanyGateway);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store
|
||||
.dispatch(UpdateCurrentRoute(CompanyGatewayViewScreen.route));
|
||||
if (companyGateway.isNew) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class CreditEditVM extends EntityEditVM {
|
|||
? localization.createdCredit
|
||||
: localization.updatedCredit);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(CreditViewScreen.route));
|
||||
if (credit.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class DocumentEditVM {
|
|||
showToast(client.isNew
|
||||
? localization.createdClient
|
||||
: localization.updatedClient);
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(DocumentViewScreen.route));
|
||||
if (document.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class ExpenseEditVM {
|
|||
? localization.createdExpense
|
||||
: localization.updatedExpense);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(ExpenseViewScreen.route));
|
||||
if (expense.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class ExpenseCategoryEditVM {
|
|||
? localization.createdExpenseCategory
|
||||
: localization.updatedExpenseCategory);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(
|
||||
UpdateCurrentRoute(ExpenseCategoryViewScreen.route));
|
||||
if (expenseCategory.isNew) {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class GroupEditVM {
|
|||
? localization.createdGroup
|
||||
: localization.updatedGroup);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(GroupViewScreen.route));
|
||||
if (group.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class InvoiceEditVM extends EntityEditVM {
|
|||
? localization.createdInvoice
|
||||
: localization.updatedInvoice);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(InvoiceViewScreen.route));
|
||||
if (invoice.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class PaymentEditVM {
|
|||
showToast(payment.isNew
|
||||
? localization.createdPayment
|
||||
: localization.updatedPayment);
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(PaymentViewScreen.route));
|
||||
if (payment.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class PaymentTermEditVM {
|
|||
? localization.createdPaymentTerm
|
||||
: localization.updatedPaymentTerm);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(PaymentTermScreen.route));
|
||||
if (paymentTerm.isNew) {
|
||||
Navigator.of(context)
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class ProductEditVM {
|
|||
? localization.createdProduct
|
||||
: localization.updatedProduct);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(ProductViewScreen.route));
|
||||
if (product.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class ProjectEditVM {
|
|||
? localization.createdProject
|
||||
: localization.updatedProject);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(ProjectViewScreen.route));
|
||||
if (project.isNew && state.projectUIState.saveCompleter == null) {
|
||||
appContext.navigator
|
||||
|
|
@ -114,7 +114,8 @@ class ProjectEditVM {
|
|||
appContext.navigator.pop(savedProject);
|
||||
}
|
||||
} else {
|
||||
viewEntity(appContext: appContext, entity: savedProject, force: true);
|
||||
viewEntity(
|
||||
appContext: appContext, entity: savedProject, force: true);
|
||||
}
|
||||
}).catchError((Object error) {
|
||||
showDialog<ErrorDialog>(
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class QuoteEditVM extends EntityEditVM {
|
|||
? localization.createdQuote
|
||||
: localization.updatedQuote);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(QuoteViewScreen.route));
|
||||
if (quote.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class RecurringInvoiceEditVM extends EntityEditVM {
|
|||
? localization.createdRecurringInvoice
|
||||
: localization.updatedRecurringInvoice);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(
|
||||
UpdateCurrentRoute(RecurringInvoiceViewScreen.route));
|
||||
if (recurringInvoice.isNew) {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class SubscriptionEditVM {
|
|||
showToast(subscription.isNew
|
||||
? localization.createdSubscription
|
||||
: localization.updatedSubscription);
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(SubscriptionViewScreen.route));
|
||||
if (subscription.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class TaskEditVM {
|
|||
? localization.createTask
|
||||
: localization.updatedTask);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(TaskViewScreen.route));
|
||||
if (task.isNew) {
|
||||
appContext.navigator.pushReplacementNamed(TaskViewScreen.route);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class TaskStatusEditVM {
|
|||
? localization.createdTaskStatus
|
||||
: localization.updatedTaskStatus);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(TaskStatusViewScreen.route));
|
||||
if (taskStatus.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class TaxRateEditVM {
|
|||
? localization.createdTaxRate
|
||||
: localization.updatedTaxRate);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(TaxRateViewScreen.route));
|
||||
if (taxRate.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class TokenEditVM {
|
|||
? localization.createdToken
|
||||
: localization.updatedToken);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(TokenViewScreen.route));
|
||||
if (token.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class UserEditVM {
|
|||
? localization.createdUser
|
||||
: localization.updatedUser);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(UserViewScreen.route));
|
||||
if (user.isNew) {
|
||||
appContext.navigator.pushReplacementNamed(UserViewScreen.route);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class VendorEditVM {
|
|||
? localization.createdVendor
|
||||
: localization.updatedVendor);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(VendorViewScreen.route));
|
||||
if (vendor.isNew && state.vendorUIState.saveCompleter == null) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class WebhookEditVM {
|
|||
? localization.createdWebhook
|
||||
: localization.updatedWebhook);
|
||||
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(WebhookViewScreen.route));
|
||||
if (webhook.isNew) {
|
||||
appContext.navigator
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class StubEditVM {
|
|||
showToast(stub.isNew
|
||||
? localization.createdStub
|
||||
: localization.updatedStub);
|
||||
if (isMobile(context)) {
|
||||
if (state.prefState.isMobile) {
|
||||
store.dispatch(UpdateCurrentRoute(StubViewScreen.route));
|
||||
if (stub.isNew) {
|
||||
Navigator.of(context).pushReplacementNamed(StubViewScreen.route);
|
||||
|
|
|
|||
Loading…
Reference in New Issue