File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import kotlin.time.Duration.Companion.seconds
1515private val LOG = KotlinLogging .logger { }
1616
1717sealed interface Event {
18- object GtaProcessNotFound : Event
18+ data class GtaProcessNotFound ( val processName : String ) : Event
1919 data class RestartError (val exception : Exception ) : Event
2020}
2121
@@ -45,6 +45,6 @@ suspend fun killGta() {
4545 }
4646 } else {
4747 LOG .error { " GTA5.exe not found" }
48- _events .emit(Event .GtaProcessNotFound )
48+ _events .emit(Event .GtaProcessNotFound (version.process) )
4949 }
5050}
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ fun GTAKiller() {
5353 gtaKillErrors
5454 .collect {
5555 val message = when (it) {
56- Event .GtaProcessNotFound -> " GTA5.exe is not running"
56+ is Event .GtaProcessNotFound -> " ${it.processName} is not running"
5757 is Event .RestartError -> it.exception.message ? : " An unknown error occurred"
5858 }
5959 snackbarHostState.showSnackbar(message, withDismissAction = true )
You can’t perform that action at this time.
0 commit comments