Skip to content

Commit d857379

Browse files
committed
Display correct process name in events
1 parent 32e2958 commit d857379

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

client/src/main/kotlin/core/ProcessHandler.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import kotlin.time.Duration.Companion.seconds
1515
private val LOG = KotlinLogging.logger { }
1616

1717
sealed 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
}

client/src/main/kotlin/ui/GTAKiller.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)