diff options
-rw-r--r-- | mobile-widgets/qml/DiveDetails.qml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index 57ef6c884..b70bb0045 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -260,7 +260,15 @@ Kirigami.Page { } function endEditMode() { - // just cancel the edit/add state + // we need to clean up either an edit or an add - and in case this + // was an add, we need to undo the addDive action that created the empty dive + // and we should also go back to the DiveDetails where we came from... + manager.appendTextToLog("endEditMode called with state " + state) + if (state === "add") { + manager.undo() + pageStack.pop() + } + // now all that is left is to cancel the edit/add state state = "view"; focus = false; Qt.inputMethod.hide(); |