QML UI: fix broken delete from dive details page

Trying to close the non-existing context drawer caused the function
to abort (and consequently not to delete the dive).

Fixes #309

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-04-15 13:49:16 -07:00
parent cc6c41c846
commit 74a5511b39

View file

@ -75,7 +75,6 @@ Kirigami.Page {
text: qsTr("Delete dive")
iconName: "trash-empty"
onTriggered: {
contextDrawer.close()
var deletedId = diveDetailsListView.currentItem.modelData.dive.id
var deletedIndex = diveDetailsListView.currentIndex
manager.deleteDive(deletedId)
@ -84,7 +83,6 @@ Kirigami.Page {
function() {
diveDetailsListView.currentIndex = manager.undoDelete(deletedId) ? deletedIndex : diveDetailsListView.currentIndex
});
contextDrawer.close() // at least one iPhone user has the drawer pop open after delete
}
}