Skip to content
Snippets Groups Projects
Unverified Commit 9f5423ba authored by Matthias Urhahn's avatar Matthias Urhahn Committed by GitHub
Browse files

A test is invalid on 40X errors (client errors), instead of checking for "NOT...

A test is invalid on 40X errors (client errors), instead of checking for "NOT CwaServerError", we check for client errors. (#2973)

This causes the error case for `SocketException` to be mapped to PENDING.
parent f65f66f7
No related branches found
No related tags found
No related merge requests found
package de.rki.coronawarnapp.submission.ui.homecards
import dagger.Reusable
import de.rki.coronawarnapp.exception.http.CwaServerError
import de.rki.coronawarnapp.exception.http.CwaClientError
import de.rki.coronawarnapp.submission.SubmissionRepository
import de.rki.coronawarnapp.submission.SubmissionSettings
import de.rki.coronawarnapp.util.CWADebug
......@@ -101,7 +101,7 @@ class SubmissionStateProvider @Inject constructor(
fun isInvalid(): Boolean =
isDeviceRegistered && when (deviceUiState) {
is NetworkRequestWrapper.RequestFailed -> deviceUiState.error !is CwaServerError
is NetworkRequestWrapper.RequestFailed -> deviceUiState.error is CwaClientError
is NetworkRequestWrapper.RequestSuccessful -> deviceUiState.data == DeviceUIState.PAIRED_REDEEMED
else -> false
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment