Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:reown-com/reown-kotlin into chai…
Browse files Browse the repository at this point in the history
…n_abstraction
  • Loading branch information
jakubuid committed Dec 6, 2024
2 parents 7772ccd + 1a50ea5 commit 1bd7a47
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@ internal class AppKitEngine(
SignClient.disconnect(Sign.Params.Disconnect(session.topic),
onSuccess = {
sendEventUseCase.send(Props(EventType.TRACK, EventType.Track.DISCONNECT_SUCCESS))
scope.launch { deleteSessionDataUseCase() }
shouldDisconnect = true
onSuccess()
scope.launch {
deleteSessionDataUseCase()
shouldDisconnect = true
onSuccess()
}
},
onError = {
sendEventUseCase.send(Props(EventType.TRACK, EventType.Track.DISCONNECT_ERROR))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ package com.reown.appkit.ui
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -34,12 +37,19 @@ import com.reown.appkit.ui.components.internal.AppKitComponent
import com.reown.appkit.ui.theme.ColorPalette

class AppKitSheet : BottomSheetDialogFragment() {
private val appTheme: Int by lazy { requireContext().applicationInfo.theme }

override fun onCreate(savedInstanceState: Bundle?) {
requireContext().setTheme(R.style.Web3ModalTheme_DialogTheme)

super.onCreate(savedInstanceState)
}

override fun onDestroy() {
super.onDestroy()
requireContext().setTheme(appTheme)
}

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
Expand Down Expand Up @@ -76,7 +86,18 @@ class AppKitSheet : BottomSheetDialogFragment() {
modifier = Modifier.nestedScroll(rememberNestedScrollInteropConnection()),
navController = navController,
shouldOpenChooseNetwork = shouldOpenChooseNetwork,
closeModal = { this@AppKitSheet.dismiss() })
closeModal = {
if (isAdded) {
if (!isStateSaved) {
this@AppKitSheet.dismiss()
} else {
Handler(Looper.getMainLooper()).post {
this@AppKitSheet.dismissAllowingStateLoss()
}
}
}
}
)
}
}

Expand Down

0 comments on commit 1bd7a47

Please sign in to comment.