Skip to content

Commit d00fac0

Browse files
committed
fix: navigating back from editing actions work
1 parent 616a0c2 commit d00fac0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

base/src/main/java/io/github/sds100/keymapper/base/actions/ConfigActionsViewModel.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ class ConfigActionsViewModel @Inject constructor(
184184
override fun onEditClick() {
185185
val actionUid = actionOptionsUid.value ?: return
186186
viewModelScope.launch {
187+
// Clear the bottom sheet so navigating back with predicted-back works
188+
actionOptionsUid.update { null }
189+
187190
val keyMap = config.keyMap.first().dataOrNull() ?: return@launch
188191

189192
val oldAction = keyMap.actionList.find { it.uid == actionUid } ?: return@launch
@@ -194,6 +197,7 @@ class ConfigActionsViewModel @Inject constructor(
194197
override fun onReplaceClick() {
195198
val actionUid = actionOptionsUid.value ?: return
196199
viewModelScope.launch {
200+
// Clear the bottom sheet so navigating back with predicted-back works
197201
actionOptionsUid.update { null }
198202

199203
val newActionData =

0 commit comments

Comments
 (0)