Skip to content

feat: save values on quit#14

Merged
bepo00 merged 2 commits into
mainfrom
save-values-on-quit
Jan 26, 2026
Merged

feat: save values on quit#14
bepo00 merged 2 commits into
mainfrom
save-values-on-quit

Conversation

@askoura
Copy link
Copy Markdown
Collaborator

@askoura askoura commented Jan 23, 2026

No description provided.

@@ -517,6 +535,10 @@ class QlarrWebView
}
}

fun saveProgressBeforeQuit() {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bepo00 ☝️

navigationDirection = NavigationDirection.Resume,
),
@JavascriptInterface
fun autoSaveValues(valuesToSave: String) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bepo00 ☝️

@askoura askoura changed the title save values on quit feat: save values on quit Jan 23, 2026
@@ -166,7 +166,8 @@ class SurveyActivity : ComponentActivity() {
Toast.LENGTH_SHORT,
).show()
} else {
finish()
qlarrWebView?.saveProgressBeforeQuit()
// finish()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove the comment

Comment on lines +359 to +364
fun quit() {
runOnUiThread {
Toast.makeText(this, getString(R.string.values_saved), Toast.LENGTH_SHORT).show()
}
finish()
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to cancel "Press back again to exit" if we already exit and at this point as otherwise this toast waits for few more seconds

Comment on lines +179 to +183

override fun onError(error: Throwable) {
surveyActivity?.reportError(error)
}
},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should exit here too. Better to not save responses then to not be able to exit the survey at all

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, amen... nice catch

@bepo00 bepo00 merged commit 64946e2 into main Jan 26, 2026
1 check passed
@askoura askoura deleted the save-values-on-quit branch June 2, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants