Fixed same events not being able to propagate consecutively
This commit is contained in:
parent
861ad9881c
commit
796c16237d
@ -5,10 +5,10 @@ import com.skoumal.teanity.viewevents.ViewEvent
|
||||
|
||||
data class OpenLinkEvent(val url: String) : ViewEvent()
|
||||
|
||||
object ManagerInstallEvent : ViewEvent()
|
||||
object MagiskInstallEvent : ViewEvent()
|
||||
class ManagerInstallEvent : ViewEvent()
|
||||
class MagiskInstallEvent : ViewEvent()
|
||||
|
||||
object ManagerChangelogEvent : ViewEvent()
|
||||
object MagiskChangelogEvent : ViewEvent()
|
||||
class ManagerChangelogEvent : ViewEvent()
|
||||
class MagiskChangelogEvent : ViewEvent()
|
||||
|
||||
object UninstallEvent : ViewEvent()
|
||||
class UninstallEvent : ViewEvent()
|
||||
|
@ -80,18 +80,18 @@ class HomeViewModel(
|
||||
fun twitterPressed() = OpenLinkEvent(Const.Url.TWITTER_URL).publish()
|
||||
fun githubPressed() = OpenLinkEvent(Const.Url.REPO_URL).publish()
|
||||
fun xdaPressed() = OpenLinkEvent(Const.Url.XDA_THREAD).publish()
|
||||
fun uninstallPressed() = UninstallEvent.publish()
|
||||
fun uninstallPressed() = UninstallEvent().publish()
|
||||
|
||||
fun advancedPressed() = isAdvancedExpanded.toggle()
|
||||
|
||||
fun installPressed(item: MagiskItem) = when (item) {
|
||||
MagiskItem.MANAGER -> ManagerInstallEvent.publish()
|
||||
MagiskItem.MAGISK -> MagiskInstallEvent.publish()
|
||||
MagiskItem.MANAGER -> ManagerInstallEvent().publish()
|
||||
MagiskItem.MAGISK -> MagiskInstallEvent().publish()
|
||||
}
|
||||
|
||||
fun cardPressed(item: MagiskItem) = when (item) {
|
||||
MagiskItem.MANAGER -> ManagerChangelogEvent.publish()
|
||||
MagiskItem.MAGISK -> MagiskChangelogEvent.publish()
|
||||
MagiskItem.MANAGER -> ManagerChangelogEvent().publish()
|
||||
MagiskItem.MAGISK -> MagiskChangelogEvent().publish()
|
||||
}
|
||||
|
||||
fun refresh() {
|
||||
|
@ -67,7 +67,7 @@ class MagiskFragment : NewMagiskFragment<HomeViewModel, com.topjohnwu.magisk.dat
|
||||
private fun installMagisk() {
|
||||
// Show Manager update first
|
||||
if (Config.remoteManagerVersionCode > BuildConfig.VERSION_CODE) {
|
||||
ManagerInstallDialog(requireActivity()).show()
|
||||
installManager()
|
||||
return
|
||||
}
|
||||
//FIXME dialog requires old base
|
||||
|
Loading…
Reference in New Issue
Block a user