Skip to content

Commit

Permalink
fix: Pressing home/up button or back key on a New Config entry should…
Browse files Browse the repository at this point in the history
… display the Discard dialog
  • Loading branch information
kaushiknsanji committed Nov 11, 2019
1 parent 1f9526e commit e0eef93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,11 @@ public void onUpOrBackAction() {
//to see if we have some unsaved changes
if (mProductId > ProductConfigContract.NEW_PRODUCT_INT) {
mProductConfigView.readExistingProductDetails();
} else {
//If this is for a New Product entry and the details are not saved,
//then display the discard dialog to see if the user wants to keep editing/discard
//the changes
mProductConfigView.showDiscardDialog();
}

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,11 @@ public void onUpOrBackAction() {
//to see if we have some unsaved changes
if (mSupplierId > SupplierConfigContract.NEW_SUPPLIER_INT) {
mSupplierConfigView.readExistingSupplierDetails();
} else {
//If this for a New Supplier entry and the details are not saved,
//then display the discard dialog to see if the user wants to keep editing/discard
//the changes
mSupplierConfigView.showDiscardDialog();
}

} else {
Expand Down

0 comments on commit e0eef93

Please sign in to comment.