Mobile: fix saving new dive

With the new setup we need to know which state we are coming from
when we are saving cylinder related info. When we are adding
a new dive we explicitly should save cylinder data to the first cylinder.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
Jocke 2018-07-29 15:42:56 +02:00 committed by Dirk Hohndel
parent bd8eec5c8e
commit 0fb086a4a5
3 changed files with 8 additions and 7 deletions

View file

@ -73,6 +73,7 @@ Item {
}
function saveData() {
var state = diveDetailsPage.state
diveDetailsPage.state = "view" // run the transition
// join cylinder info from separate string into a list.
if (usedCyl[0] != null) {
@ -114,7 +115,7 @@ Item {
detailsEdit.weightText, detailsEdit.notesText, startpressure,
endpressure, usedGas, usedCyl ,
detailsEdit.rating,
detailsEdit.visibility)
detailsEdit.visibility, state)
// trigger the profile to be redrawn
QMLProfile.diveId = dive_id