Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ internal class LogsReducer @Inject constructor() : Reducer<LogsState, LogsComman
}

is LogsCommand.ClearLogs -> {
state.withSideEffects(LogsSideEffect.ClearLogs)
state.copy(
logs = emptyList(),
selectedIds = emptySet(),
expandedOverrides = emptyMap(),
logsChanged = true,
).withSideEffects(LogsSideEffect.ClearLogs)
}

is LogsCommand.RestartLogging -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package com.f0x1d.logfox.feature.recordings.api.domain
import android.net.Uri

interface ExportRecordingZipUseCase {
suspend operator fun invoke(recordingId: Long, uri: Uri)
suspend operator fun invoke(recordingId: Long, uri: Uri): Result<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ internal class ExportRecordingZipUseCaseImpl @Inject constructor(
private val dateTimeFormatter: DateTimeFormatter,
) : ExportRecordingZipUseCase {

override suspend fun invoke(recordingId: Long, uri: Uri) {
val recording = recordingsRepository.getById(recordingId) ?: return
override suspend fun invoke(recordingId: Long, uri: Uri) = runCatching {
val recording = recordingsRepository.getById(recordingId) ?: return@runCatching
val includeDeviceInfo = getIncludeDeviceInfoInArchivesUseCase()
val logExtension = if (getExportLogsAsTxtUseCase()) "txt" else "log"
val suffix = dateTimeFormatter.formatForExport(recording.dateAndTime)
Expand Down