mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Fix a crash when attempting to send a bug report with excessively large logs. (#4243)
* Alert the user when there are excessively large log files.
This commit is contained in:
@@ -14,6 +14,7 @@ struct BugReportScreen: View {
|
||||
|
||||
@Bindable var context: BugReportScreenViewModel.Context
|
||||
|
||||
var canSendLogFiles: Bool { context.viewState.canSendLogFiles }
|
||||
var photosPickerTitle: String { context.viewState.screenshot == nil ? L10n.screenBugReportAttachScreenshot : L10n.screenBugReportEditScreenshot }
|
||||
|
||||
var body: some View {
|
||||
@@ -56,15 +57,23 @@ struct BugReportScreen: View {
|
||||
|
||||
private var sendLogsSection: some View {
|
||||
Section {
|
||||
ListRow(label: .plain(title: L10n.screenBugReportIncludeLogs),
|
||||
kind: .toggle($context.sendingLogsEnabled))
|
||||
.accessibilityIdentifier(A11yIdentifiers.bugReportScreen.sendLogs)
|
||||
if canSendLogFiles {
|
||||
ListRow(label: .plain(title: L10n.screenBugReportIncludeLogs),
|
||||
kind: .toggle($context.sendingLogsEnabled))
|
||||
.accessibilityIdentifier(A11yIdentifiers.bugReportScreen.sendLogs)
|
||||
}
|
||||
ListRow(label: .plain(title: L10n.screenBugReportViewLogs),
|
||||
kind: .navigationLink { context.send(viewAction: .viewLogs) })
|
||||
.accessibilityIdentifier(A11yIdentifiers.bugReportScreen.sendLogs)
|
||||
} footer: {
|
||||
Text(L10n.screenBugReportLogsDescription)
|
||||
.compoundListSectionFooter()
|
||||
if canSendLogFiles {
|
||||
Text(L10n.screenBugReportLogsDescription)
|
||||
.compoundListSectionFooter()
|
||||
} else {
|
||||
Label(L10n.screenBugReportIncludeLogsError, icon: \.errorSolid, iconSize: .xSmall, relativeTo: .compound.bodySM)
|
||||
.foregroundStyle(.compound.textCriticalPrimary)
|
||||
.compoundListSectionFooter()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user