Skip to content

Commit

Permalink
Update example activity
Browse files Browse the repository at this point in the history
  • Loading branch information
simond-stripe committed Nov 13, 2024
1 parent 94ca471 commit 16db6f3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import com.stripe.android.connect.example.data.EmbeddedComponentManagerProvider
import com.stripe.android.connect.example.ui.common.BackIconButton
import com.stripe.android.core.Logger
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import javax.inject.Inject

@OptIn(PrivateBetaConnectSDK::class)
Expand All @@ -47,7 +49,9 @@ class PayoutsExampleActivity : FragmentActivity() {
requestPermissionLauncher = registerForActivityResult(
ActivityResultContracts.RequestPermission()
) { isGranted ->
requestPermissionFlow.tryEmit(isGranted)
MainScope().launch {
requestPermissionFlow.emit(isGranted)
}
}

setContent {
Expand Down

0 comments on commit 16db6f3

Please sign in to comment.