Skip to content

Commit

Permalink
feat: 重複して取得されてしまう問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
pantasystem committed Sep 7, 2024
1 parent f1a9e9d commit e49379c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class NotificationStoreImpl(
override suspend fun convertAll(list: List<Notification>): List<Notification.Id> {
return list.map {
it.id
}
}.distinct()
}

override suspend fun loadPrevious(): Result<List<Notification>> = runCancellableCatching {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ class NotificationTimelineRepositoryImpl @Inject constructor(
lastFetchTimeMap += accountId to now
}

fetched
fetched.filterNot {
it.id.notificationId == untilId
}
}

override suspend fun findLaterTimeline(
Expand Down Expand Up @@ -141,7 +143,9 @@ class NotificationTimelineRepositoryImpl @Inject constructor(
lastFetchTimeMap += accountId to now
}

fetched
fetched.filterNot {
it.id.notificationId == sinceId
}
}

private suspend fun fetch(
Expand Down

0 comments on commit e49379c

Please sign in to comment.