cozy / cozy-flagship-app

GNU Affero General Public License v3.0
9 stars 1 forks source link

[VO-428] fix: Prevent the app to stuck on SplashScreen after a restart notification #1181

Closed Ldoppea closed 7 months ago

Ldoppea commented 7 months ago

On Android, when the app request a restart, the current Activity is not directly destroyed and the app react as if it was sent to background

This triggers the useGlobalAppState hooks which shows the LOCK_SCREEN splashScreen

The after the app effectively restarted, it fails to hide all splashScreens because the LOCK_SCREEN one is not expected to be displayed (but it is)

To prevent this kind of side effects, we want to fully unmount the components tree, so all hooks would unregister themselves

This PR also fix some hideSplashScreen scenario and improve logs

### ✨ Features

* Update the existing IAP entry with this PR (was not in production yet)

TODO: