Skip to content

Commit

Permalink
[fix]: select all feature
Browse files Browse the repository at this point in the history
  • Loading branch information
F0x1d committed Jul 14, 2024
1 parent 1ea56f4 commit a59177d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class LoggingService : LifecycleService() {
private val logs = LinkedList<LogLine>()
private val logsMutex = Mutex()
private var loggingJob: Job? = null
private var idsCounter = -1L

private lateinit var filtersState: StateFlow<List<UserFilter>>

Expand Down Expand Up @@ -140,7 +139,7 @@ class LoggingService : LifecycleService() {
while (true) {
loggingRepository.startLogging(
terminal = loggingTerminal,
startingId = idsCounter,
startingId = logs.lastOrNull()?.id ?: 0,
).catch { throwable ->
if (throwable is TerminalNotSupportedException) {
if (appPreferences.fallbackToDefaultTerminal) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class LogsViewModel @Inject constructor(
}

fun selectAll() {
if (selectedItems.value == logs.value) selectedItems.update {
if (selectedItems.value.containsAll(logs.value)) selectedItems.update {
emptySet()
} else selectedItems.update {
logs.value.toSet()
Expand Down

0 comments on commit a59177d

Please sign in to comment.