diff --git a/app/src/main/java/eu/kanade/presentation/reader/DisplayRefreshHost.kt b/app/src/main/java/eu/kanade/presentation/reader/DisplayRefreshHost.kt index a97ad97257..ecf26119d0 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/DisplayRefreshHost.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/DisplayRefreshHost.kt @@ -59,21 +59,23 @@ fun DisplayRefreshHost( var currentColor by remember { mutableStateOf(null) } LaunchedEffect(currentDisplayRefresh) { - if (currentDisplayRefresh) { - val refreshDurationHalf = refreshDuration.milliseconds / 2 - currentColor = if (flashMode == ReaderPreferences.FlashColor.BLACK) { - Color.Black - } else { - Color.White - } - delay(refreshDurationHalf) - if (flashMode == ReaderPreferences.FlashColor.WHITE_BLACK) { - currentColor = Color.Black - } - delay(refreshDurationHalf) + if (!currentDisplayRefresh) { currentColor = null - hostState.currentDisplayRefresh = false + return@LaunchedEffect } + + val refreshDurationHalf = refreshDuration.milliseconds / 2 + currentColor = if (flashMode == ReaderPreferences.FlashColor.BLACK) { + Color.Black + } else { + Color.White + } + delay(refreshDurationHalf) + if (flashMode == ReaderPreferences.FlashColor.WHITE_BLACK) { + currentColor = Color.Black + } + delay(refreshDurationHalf) + hostState.currentDisplayRefresh = false } LaunchedEffect(flashInterval) {