Skip to content

Commit fcefbaf

Browse files
committed
πŸ“ˆ improve market open
1 parent 498ee85 commit fcefbaf

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

β€Žsrc/main/kotlin/com/theapache64/stackzy/ui/feature/selectapp/SelectAppViewModel.kt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.theapache64.stackzy.ui.feature.selectapp
33
import com.github.theapache64.gpa.api.Play
44
import com.github.theapache64.gpa.model.Account
55
import com.theapache64.stackzy.data.local.AndroidApp
6-
import com.theapache64.stackzy.data.local.AndroidDevice
76
import com.theapache64.stackzy.data.repo.AdbRepo
87
import com.theapache64.stackzy.data.repo.PlayStoreRepo
98
import com.theapache64.stackzy.data.util.calladapter.flow.Resource
@@ -153,16 +152,12 @@ class SelectAppViewModel @Inject constructor(
153152
}
154153

155154
fun onOpenMarketClicked() {
156-
when (apkSource) {
157-
is ApkSource.Adb -> {
158-
viewModelScope.launch {
159-
val androidDevice = (apkSource as ApkSource.Adb<AndroidDevice>).value
160-
adbRepo.launchMarket(androidDevice, searchKeyword.value)
161-
}
155+
if (apkSource is ApkSource.Adb) {
156+
viewModelScope.launch {
157+
val androidDevice = (apkSource as ApkSource.Adb<AndroidDeviceWrapper>).value.androidDevice
158+
adbRepo.launchMarket(androidDevice, searchKeyword.value)
162159
}
163-
is ApkSource.PlayStore -> TODO()
164160
}
165-
166161
}
167162

168163
/**

0 commit comments

Comments
Β (0)