Skip to content
Snippets Groups Projects
Unverified Commit 50109523 authored by Philipp Woessner's avatar Philipp Woessner Committed by GitHub
Browse files

Check if ENF is enabled before getting the exposure summary (EXPOSUREAPP-2080) (#992)

* check if ENF is enabled before getting the exposure summary

* added mock for InternalExposureNotificationClient.asyncIsEnabled()

* deleted ru translation file
parent c47729f0
No related branches found
No related tags found
No related merge requests found
...@@ -47,12 +47,14 @@ class ExposureSummaryRepository(private val exposureSummaryDao: ExposureSummaryD ...@@ -47,12 +47,14 @@ class ExposureSummaryRepository(private val exposureSummaryDao: ExposureSummaryD
ExposureSummaryRepository.daysSinceLastExposure.postValue(daysSinceLastExposure) ExposureSummaryRepository.daysSinceLastExposure.postValue(daysSinceLastExposure)
} }
suspend fun getLatestExposureSummary(token: String) = suspend fun getLatestExposureSummary(token: String) {
InternalExposureNotificationClient.asyncGetExposureSummary(token) if (InternalExposureNotificationClient.asyncIsEnabled())
.also { InternalExposureNotificationClient.asyncGetExposureSummary(token)
matchedKeyCount.postValue(it.matchedKeyCount) .also {
daysSinceLastExposure.postValue(it.daysSinceLastExposure) matchedKeyCount.postValue(it.matchedKeyCount)
} daysSinceLastExposure.postValue(it.daysSinceLastExposure)
}
}
private fun ExposureSummaryEntity.convertToExposureSummary() = private fun ExposureSummaryEntity.convertToExposureSummary() =
ExposureSummary.ExposureSummaryBuilder() ExposureSummary.ExposureSummaryBuilder()
......
This diff is collapsed.
...@@ -731,7 +731,7 @@ ...@@ -731,7 +731,7 @@
<!-- XHED: Dialog title for submission tan redeemed --> <!-- XHED: Dialog title for submission tan redeemed -->
<string name="submission_error_dialog_web_tan_redeemed_title">"Test has errors"</string> <string name="submission_error_dialog_web_tan_redeemed_title">"Test has errors"</string>
<!-- XMSG: Dialog body for submission tan redeemed --> <!-- XMSG: Dialog body for submission tan redeemed -->
<string name="submission_error_dialog_web_tan_redeemed_body">"There was a problem evaluating your test. Your QR Code has already expired."</string> <string name="submission_error_dialog_web_tan_redeemed_body">"There was a problem evaluating your test. Your QR code has already expired."</string>
<!-- XBUT: Positive button for submission tan redeemed --> <!-- XBUT: Positive button for submission tan redeemed -->
<string name="submission_error_dialog_web_tan_redeemed_button_positive">"OK"</string> <string name="submission_error_dialog_web_tan_redeemed_button_positive">"OK"</string>
......
...@@ -32,6 +32,7 @@ class ExposureSummaryRepositoryTest { ...@@ -32,6 +32,7 @@ class ExposureSummaryRepositoryTest {
mockkObject(InternalExposureNotificationClient) mockkObject(InternalExposureNotificationClient)
coEvery { InternalExposureNotificationClient.asyncGetExposureSummary(any()) } returns buildSummary() coEvery { InternalExposureNotificationClient.asyncGetExposureSummary(any()) } returns buildSummary()
coEvery { InternalExposureNotificationClient.asyncIsEnabled() } returns true
coEvery { dao.getExposureSummaryEntities() } returns listOf() coEvery { dao.getExposureSummaryEntities() } returns listOf()
coEvery { dao.getLatestExposureSummary() } returns null coEvery { dao.getLatestExposureSummary() } returns null
......
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