Bug: if refresh ends when creating an invoice it’s cleared
This commit is contained in:
parent
07c0e8aec4
commit
ea61217238
|
|
@ -56,7 +56,6 @@ final editingReducer = combineReducers<CompanyGatewayEntity>([
|
|||
(companyGateway, action) {
|
||||
return action.companyGateway.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<CompanyGatewayEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<CompanyGatewayEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ final editingReducer = combineReducers<InvoiceEntity>([
|
|||
TypedReducer<InvoiceEntity, AddCreditItems>(_addCreditItems),
|
||||
TypedReducer<InvoiceEntity, DeleteCreditItem>(_removeCreditItem),
|
||||
TypedReducer<InvoiceEntity, UpdateCreditItem>(_updateCreditItem),
|
||||
TypedReducer<InvoiceEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<InvoiceEntity, DiscardChanges>(_clearEditing),
|
||||
TypedReducer<InvoiceEntity, AddCreditContact>((invoice, action) {
|
||||
return invoice.rebuild((b) => b
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ final editingReducer = combineReducers<DesignEntity>([
|
|||
TypedReducer<DesignEntity, UpdateDesign>((design, action) {
|
||||
return action.design.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<DesignEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<DesignEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,13 +35,8 @@ final editingReducer = combineReducers<DocumentEntity>([
|
|||
TypedReducer<DocumentEntity, UpdateDocument>((document, action) {
|
||||
return action.document.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<DocumentEntity, SelectCompany>(_clearEditing),
|
||||
]);
|
||||
|
||||
DocumentEntity _clearEditing(DocumentEntity document, dynamic action) {
|
||||
return DocumentEntity();
|
||||
}
|
||||
|
||||
DocumentEntity _updateEditing(DocumentEntity document, dynamic action) {
|
||||
return action.document;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ final editingReducer = combineReducers<ExpenseEntity>([
|
|||
TypedReducer<ExpenseEntity, UpdateExpense>((expense, action) {
|
||||
return action.expense.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<ExpenseEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<ExpenseEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ final editingReducer = combineReducers<GroupEntity>([
|
|||
TypedReducer<GroupEntity, UpdateGroup>((group, action) {
|
||||
return action.group.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<GroupEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<GroupEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,6 @@ final editingReducer = combineReducers<InvoiceEntity>([
|
|||
TypedReducer<InvoiceEntity, AddInvoiceItems>(_addInvoiceItems),
|
||||
TypedReducer<InvoiceEntity, DeleteInvoiceItem>(_removeInvoiceItem),
|
||||
TypedReducer<InvoiceEntity, UpdateInvoiceItem>(_updateInvoiceItem),
|
||||
TypedReducer<InvoiceEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<InvoiceEntity, DiscardChanges>(_clearEditing),
|
||||
TypedReducer<InvoiceEntity, AddInvoiceContact>((invoice, action) {
|
||||
return invoice.rebuild((b) => b
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ final editingReducer = combineReducers<PaymentEntity>([
|
|||
TypedReducer<PaymentEntity, UpdatePayment>((payment, action) {
|
||||
return action.payment.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<PaymentEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<PaymentEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ final editingReducer = combineReducers<PaymentTermEntity>([
|
|||
TypedReducer<PaymentTermEntity, UpdatePaymentTerm>((paymentTerm, action) {
|
||||
return action.paymentTerm.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<PaymentTermEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<PaymentTermEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ final editingReducer = combineReducers<ProductEntity>([
|
|||
TypedReducer<ProductEntity, DeleteProductsSuccess>((products, action) {
|
||||
return action.products[0];
|
||||
}),
|
||||
TypedReducer<ProductEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<ProductEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ final editingReducer = combineReducers<ProjectEntity>([
|
|||
TypedReducer<ProjectEntity, UpdateProject>((project, action) {
|
||||
return action.project.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<ProjectEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<ProjectEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ final editingReducer = combineReducers<InvoiceEntity>([
|
|||
TypedReducer<InvoiceEntity, AddQuoteItems>(_addQuoteItems),
|
||||
TypedReducer<InvoiceEntity, DeleteQuoteItem>(_removeQuoteItem),
|
||||
TypedReducer<InvoiceEntity, UpdateQuoteItem>(_updateQuoteItem),
|
||||
TypedReducer<InvoiceEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<InvoiceEntity, DiscardChanges>(_clearEditing),
|
||||
TypedReducer<InvoiceEntity, AddQuoteContact>((invoice, action) {
|
||||
return invoice.rebuild((b) => b
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ final editingReducer = combineReducers<TaskEntity>([
|
|||
TypedReducer<TaskEntity, AddTaskTime>(_addTaskTime),
|
||||
TypedReducer<TaskEntity, DeleteTaskTime>(_removeTaskTime),
|
||||
TypedReducer<TaskEntity, UpdateTaskTime>(_updateTaskTime),
|
||||
TypedReducer<TaskEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<TaskEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ final editingReducer = combineReducers<TaxRateEntity>([
|
|||
TypedReducer<TaxRateEntity, UpdateTaxRate>((taxRate, action) {
|
||||
return action.taxRate.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<TaxRateEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<TaxRateEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ final editingReducer = combineReducers<TokenEntity>([
|
|||
TypedReducer<TokenEntity, UpdateToken>((token, action) {
|
||||
return action.token.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<TokenEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<TokenEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ final editingReducer = combineReducers<UserEntity>([
|
|||
TypedReducer<UserEntity, UpdateUser>((user, action) {
|
||||
return action.user.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<UserEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<UserEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ final editingReducer = combineReducers<VendorEntity>([
|
|||
TypedReducer<VendorEntity, AddVendorContact>(_addContact),
|
||||
TypedReducer<VendorEntity, DeleteVendorContact>(_removeContact),
|
||||
TypedReducer<VendorEntity, UpdateVendorContact>(_updateContact),
|
||||
TypedReducer<VendorEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<VendorEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ final editingReducer = combineReducers<WebhookEntity>([
|
|||
TypedReducer<WebhookEntity, UpdateWebhook>((webhook, action) {
|
||||
return action.webhook.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<WebhookEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<WebhookEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class MenuDrawerVM {
|
|||
context: context,
|
||||
callback: () {
|
||||
store.dispatch(ClearEntityFilter());
|
||||
store.dispatch(DiscardChanges());
|
||||
store.dispatch(SelectCompany(companyIndex: index));
|
||||
if (store.state.isStale) {
|
||||
if (!store.state.isLoaded && store.state.company.isLarge) {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ final editingReducer = combineReducers<StubEntity>([
|
|||
TypedReducer<StubEntity, UpdateStub>((stub, action) {
|
||||
return action.stub.rebuild((b) => b..isChanged = true);
|
||||
}),
|
||||
TypedReducer<StubEntity, SelectCompany>(_clearEditing),
|
||||
TypedReducer<StubEntity, DiscardChanges>(_clearEditing),
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue