I'm researching an idea of (not only) navigation s...
# compose-desktop
a
I'm researching an idea of (not only) navigation state preservation with Decompose. This already works for Android and Darwin targets, and it looks possible to also add this feature for JVM. Like you close your app and when you re-open it, the navigation state (as well as any other state) is restored. This would be an opt-in feature. Is it something that sounds useful?
👍 6
👍🏻 1
p
Are you talking about the App closing due to process death? Other than process death, if the user closed the App then they want to start from zero next time. Assuming process death, IMO, I rather let the user start from the initial screen again. However, if it is an opt-in feature, that doesn't involve too much complexity, able to be added as a plugin or so. It sounds cool then
a
In case of a crash, absolutely not - the app would start from the initial screen. I'm mostly talking about the case when the app is closed normally (like pressing the X button on the main window). So there would be a possibility to save the state into a file in your
onCloseRequest
, and then restore it at start.
p
I got you. I mean, in that case I will keep my stance on, if the user closes it, they want to start from the beginning the next time. However, specific Apps may need that feature. I don't have a use case off the top of my head but it is very possible.