mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Fix close error dialog has no effect.
This commit is contained in:
committed by
Benoit Marty
parent
fc2dfacd7e
commit
8302af2dc6
+2
@@ -19,6 +19,8 @@ package io.element.android.features.rageshake.impl.bugreport
|
|||||||
sealed interface BugReportEvents {
|
sealed interface BugReportEvents {
|
||||||
object SendBugReport : BugReportEvents
|
object SendBugReport : BugReportEvents
|
||||||
object ResetAll : BugReportEvents
|
object ResetAll : BugReportEvents
|
||||||
|
object ClearError : BugReportEvents
|
||||||
|
|
||||||
data class SetDescription(val description: String) : BugReportEvents
|
data class SetDescription(val description: String) : BugReportEvents
|
||||||
data class SetSendLog(val sendLog: Boolean) : BugReportEvents
|
data class SetSendLog(val sendLog: Boolean) : BugReportEvents
|
||||||
data class SetSendCrashLog(val sendCrashlog: Boolean) : BugReportEvents
|
data class SetSendCrashLog(val sendCrashlog: Boolean) : BugReportEvents
|
||||||
|
|||||||
+4
@@ -109,6 +109,10 @@ class BugReportPresenter @Inject constructor(
|
|||||||
is BugReportEvents.SetSendScreenshot -> updateFormState(formState) {
|
is BugReportEvents.SetSendScreenshot -> updateFormState(formState) {
|
||||||
copy(sendScreenshot = event.sendScreenshot)
|
copy(sendScreenshot = event.sendScreenshot)
|
||||||
}
|
}
|
||||||
|
BugReportEvents.ClearError -> {
|
||||||
|
sendingProgress.value = 0f
|
||||||
|
sendingAction.value = Async.Uninitialized
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -204,6 +204,7 @@ fun BugReportView(
|
|||||||
}
|
}
|
||||||
is Async.Failure -> ErrorDialog(
|
is Async.Failure -> ErrorDialog(
|
||||||
content = state.sending.error.toString(),
|
content = state.sending.error.toString(),
|
||||||
|
onDismiss = { state.eventSink(BugReportEvents.ClearError) }
|
||||||
)
|
)
|
||||||
else -> Unit
|
else -> Unit
|
||||||
}
|
}
|
||||||
|
|||||||
+5
@@ -222,6 +222,11 @@ class BugReportPresenterTest {
|
|||||||
// Failure
|
// Failure
|
||||||
assertThat(awaitItem().sendingProgress).isEqualTo(0f)
|
assertThat(awaitItem().sendingProgress).isEqualTo(0f)
|
||||||
assertThat((awaitItem().sending as Async.Failure).error.message).isEqualTo(A_FAILURE_REASON)
|
assertThat((awaitItem().sending as Async.Failure).error.message).isEqualTo(A_FAILURE_REASON)
|
||||||
|
// Reset failure
|
||||||
|
initialState.eventSink.invoke(BugReportEvents.ClearError)
|
||||||
|
val lastItem = awaitItem()
|
||||||
|
assertThat(lastItem.sendingProgress).isEqualTo(0f)
|
||||||
|
assertThat(lastItem.sending).isInstanceOf(Async.Uninitialized::class.java)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user