Skip to content

Commit

Permalink
fix: more issues with sharing media [WPB-9550] (#3088)
Browse files Browse the repository at this point in the history
  • Loading branch information
saleniuk authored Jun 6, 2024
1 parent af34214 commit b061616
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions app/src/main/kotlin/com/wire/android/ui/WireActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,17 @@ class WireActivity : AppCompatActivity() {

override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
setIntent(intent)
if (isNavigationCollecting) {
// when true then navigationCommands is subscribed and can handle navigation commands
/*
* - When true then navigationCommands is subscribed and can handle navigation commands right away.
* - When false then navigationCommands needs to be subscribed again to be able to receive and handle navigation commands.
*
* Activity intent is updated anyway using setIntent(intent) so that we always keep the latest intent received, so when
* isNavigationCollecting is false then we handle it after navigationCommands is subscribed again and onComplete called again.
* We make sure to handle particular intent only once thanks to the flag HANDLED_DEEPLINK_FLAG put into the handled intent.
*/
handleDeepLink(intent)
} else {
// when false then navigationCommands needs to be subscribed again to be able to receive and handle navigation commands
// Activity intent is updated to handle deep link after navigationCommands is subscribed again and onComplete called again
setIntent(intent)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private fun ImportMediaAuthenticatedContent(
pendingBundles = ArrayList(it)
)
),
BackStackMode.UPDATE_EXISTED
BackStackMode.REMOVE_CURRENT_AND_REPLACE
),
)
}
Expand Down

0 comments on commit b061616

Please sign in to comment.