Skip to content

Commit 9bade72

Browse files
Fix uneccessary confirmation dialog when reopenning a form (#3690)
* Fix unneccessary confirmation dialog when saving and reopening a feature form
1 parent fb176e3 commit 9bade72

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

app/qml/form/MMFormStackController.qml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ Item {
1515

1616
/*
1717
* MMFormsStackManager component is responsible for viewing feature forms, both preview and fullscreen form
18-
* It contains a stackview where instances of FormWrapper are pushed. Latest form is not destroyed, but reused
19-
* for next feature to reduce a cost of initializing form and AttributeController each time user selects feature.
20-
*/
18+
* It contains a stackview where instances of FormWrapper are pushed.
19+
*/
2120

2221
property var project
2322

@@ -113,8 +112,7 @@ Item {
113112

114113
function closeAll() {
115114
// close permanetly all drawers (not only hide)
116-
let form = formsStack.get( 0 )
117-
formsStack.pop( form )
115+
formsStack.clear()
118116
}
119117

120118
function reopenAll() {
@@ -257,11 +255,16 @@ Item {
257255
id: formsStack
258256

259257
function popOneOrClose() {
260-
formsStack.pop()
258+
if ( formsStack.depth > 1 ) {
259+
formsStack.pop()
260+
}
261+
else {
262+
formsStack.clear()
263+
}
261264

262-
if ( formsStack.depth <= 1 )
265+
if ( formsStack.depth === 0 )
263266
{
264-
root.closed() // this is the top most form, we want to keep it instantiated, just invisible
267+
root.closed()
265268
}
266269
}
267270

0 commit comments

Comments
 (0)