fix(mobile): prevent upload intent replacement in splash screen and reset upload button when minimize app #18914
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
-- Issue 1
When the app is closed and we want to share a picture to immich (via share intent) the app open, it shows the share intent but then navigate directly to the timeline.
This is not happening when the app is already open.
Issue were because in the Splashscreen logic code we were navigating always to the Timelime; I've added a check to not push the timeline route if we are on the share intent.
There is a kind of new logic here, now, when we go back from a share intent it will always go to the timeline as before if the app was open, it would go back which could have been on a picture for example
-- Issue 2
When we upload a file via the share intent, minimize the app and upload another file, the upload button was disabled
The issue was caused because the share intent window is not rebuilt, I've added a lifecycle check to reset the upload button state on resume.
Fixes #18771
How Has This Been Tested?
Close the app
Share a picture to Immich
Page should be present; and can upload
On back, it should go to timeline
Close the app
Share a picture to immich
Upload and minimize the app
Select an new picture to upload
Upload button is blue (in a uploading state possible)
Click and the picture should be uploaded
Screenshots (if appropriate)
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)