diff --git a/ui/home/src/main/kotlin/com/github/kr328/clash/home/vm/HomeViewModel.kt b/ui/home/src/main/kotlin/com/github/kr328/clash/home/vm/HomeViewModel.kt index 8d46de28f0..a0bf554765 100644 --- a/ui/home/src/main/kotlin/com/github/kr328/clash/home/vm/HomeViewModel.kt +++ b/ui/home/src/main/kotlin/com/github/kr328/clash/home/vm/HomeViewModel.kt @@ -69,11 +69,6 @@ internal class HomeViewModel(app: Application) : AndroidViewModel(app), DefaultL trafficPollingJob = null } - override fun onCleared() { - broadcastEventsJob?.cancel() - trafficPollingJob?.cancel() - } - fun toggleStatus() { if (clashRunning.value) { application.stopClashService() diff --git a/ui/profile/src/main/kotlin/com/github/kr328/clash/profile/vm/ProfilesViewModel.kt b/ui/profile/src/main/kotlin/com/github/kr328/clash/profile/vm/ProfilesViewModel.kt index d6052197c7..dff4aa837d 100644 --- a/ui/profile/src/main/kotlin/com/github/kr328/clash/profile/vm/ProfilesViewModel.kt +++ b/ui/profile/src/main/kotlin/com/github/kr328/clash/profile/vm/ProfilesViewModel.kt @@ -66,12 +66,6 @@ internal class ProfilesViewModel(app: Application) : elapsedJob = null } - override fun onCleared() { - broadcastEventsJob?.cancel() - elapsedJob?.cancel() - fetchJob?.cancel() - } - fun consumeEvent() { eventState.value = EventState.Idle } diff --git a/ui/profile/src/main/kotlin/com/github/kr328/clash/profile/vm/ProvidersViewModel.kt b/ui/profile/src/main/kotlin/com/github/kr328/clash/profile/vm/ProvidersViewModel.kt index 2db2aa8411..fde779f4a7 100644 --- a/ui/profile/src/main/kotlin/com/github/kr328/clash/profile/vm/ProvidersViewModel.kt +++ b/ui/profile/src/main/kotlin/com/github/kr328/clash/profile/vm/ProvidersViewModel.kt @@ -54,12 +54,6 @@ internal class ProvidersViewModel(app: Application) : elapsedJob = null } - override fun onCleared() { - broadcastEventsJob?.cancel() - elapsedJob?.cancel() - fetchJob?.cancel() - } - fun consumeEvent() { eventState.value = EventState.Idle } diff --git a/ui/proxy/src/main/kotlin/com/github/kr328/clash/proxy/vm/ProxyViewModel.kt b/ui/proxy/src/main/kotlin/com/github/kr328/clash/proxy/vm/ProxyViewModel.kt index b7953126f2..eed4f9c498 100644 --- a/ui/proxy/src/main/kotlin/com/github/kr328/clash/proxy/vm/ProxyViewModel.kt +++ b/ui/proxy/src/main/kotlin/com/github/kr328/clash/proxy/vm/ProxyViewModel.kt @@ -78,13 +78,6 @@ internal class ProxyViewModel(app: Application) : AndroidViewModel(app), Default fetchInitialStateJob = null } - override fun onCleared() { - broadcastEventsJob?.cancel() - broadcastEventsJob = null - fetchInitialStateJob?.cancel() - fetchInitialStateJob = null - } - fun consumeEvent() { eventState.value = EventState.Idle }