diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/LoadingViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/LoadingViewModel.kt index 3a837b76f1..9cfa86c693 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/LoadingViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/LoadingViewModel.kt @@ -49,22 +49,25 @@ internal class LoadingViewModel @Inject constructor( .onStart { emit(TextSecurePreferences.CONFIGURATION_SYNCED) } .filter { prefs.getConfigurationMessageSynced() } .timeout(TIMEOUT_TIME) - .flowOn(Dispatchers.Main) .collectLatest { onSuccess() } } catch (e: Exception) { - withContext(Dispatchers.Main) { onFail() } + onFail() } } } private suspend fun onSuccess() { - _states.value = State(ANIMATE_TO_DONE_TIME) - delay(IDLE_DONE_TIME) - _events.emit(Event.SUCCESS) + withContext(Dispatchers.Main) { + _states.value = State(ANIMATE_TO_DONE_TIME) + delay(IDLE_DONE_TIME) + _events.emit(Event.SUCCESS) + } } private suspend fun onFail() { - _events.emit(Event.TIMEOUT) + withContext(Dispatchers.Main) { + _events.emit(Event.TIMEOUT) + } } } diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/color/Colors.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/color/Colors.kt index f2f96f8c15..1369661b9d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/color/Colors.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/color/Colors.kt @@ -40,7 +40,7 @@ interface Colors { val backgroundBubbleSent: Color get() = primary // buttonFill - val buttonFill: Color get() = text + val buttonFill: Color val buttonFillText: Color get() = background // primaryButtonFill