Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unread count in title for groups (tags) #308

Merged
merged 2 commits into from
Jun 14, 2024
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 @@ -97,13 +97,15 @@ class Repository(override val di: DI) : DIAware {

val currentFeedAndTag: StateFlow<Pair<Long, String>> = settingsStore.currentFeedAndTag

fun getUnreadCount(feedId: Long) =
feedItemStore.getFeedItemCountRaw(
feedId = feedId,
tag = "",
minReadTime = Instant.now(),
filter = emptyFeedListFilter,
)
fun getUnreadCount(
feedId: Long,
tag: String = "",
) = feedItemStore.getFeedItemCountRaw(
feedId = feedId,
tag = tag,
minReadTime = Instant.now(),
filter = emptyFeedListFilter,
)

fun setCurrentFeedAndTag(
feedId: Long,
Expand Down Expand Up @@ -419,7 +421,7 @@ class Repository(override val di: DI) : DIAware {
fun getScreenTitleForFeedOrTag(
feedId: Long,
tag: String,
) = getUnreadCount(feedId).mapLatest { unreadCount ->
) = getUnreadCount(feedId, tag).mapLatest { unreadCount ->
ScreenTitle(
title =
when {
Expand All @@ -441,7 +443,7 @@ class Repository(override val di: DI) : DIAware {
@OptIn(ExperimentalCoroutinesApi::class)
fun getScreenTitleForCurrentFeedOrTag(): Flow<ScreenTitle> =
currentFeedAndTag.flatMapLatest { (feedId, tag) ->
getUnreadCount(feedId).mapLatest { unreadCount ->
getUnreadCount(feedId, tag).mapLatest { unreadCount ->
ScreenTitle(
title =
when {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,6 @@
<string name="skip_duplicate_articles">Doppelte Artikel überspringen</string>
<string name="skip_duplicate_articles_desc">Artikel mit Links oder Titeln, die mit bestehenden Artikeln identisch sind, werden ignoriert</string>
<string name="feed_item_style_compact_card">Kompakte Kartei</string>
<string name="show_title_unread_count">Zeige Anzahl ungelesener Artikel im Titel</string>
<string name="show_title_unread_count">Anzahl ungelesener Artikel im Titel anzeigen</string>
<string name="touch_to_play_audio">Berühren, um Audio abzuspielen</string>
</resources>
Loading