Skip to content

Commit

Permalink
fix: use subscription category
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed Jan 17, 2025
1 parent 57fa45d commit 43e5c64
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions apps/mobile/src/store/entry/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,6 @@ class EntryActions {
for (const entry of entries) {
draft.data[entry.id] = entry

if (entry.categories) {
for (const category of entry.categories) {
let entryIdSetByCategory = draft.entryIdByCategory[category]
if (!entryIdSetByCategory) {
entryIdSetByCategory = new Set<EntryId>()
draft.entryIdByCategory[category] = entryIdSetByCategory
}
entryIdSetByCategory.add(entry.id)
}
}

const { feedId, inboxHandle } = entry
if (feedId) {
let entryIdSetByFeed = draft.entryIdByFeed[feedId]
Expand All @@ -78,6 +67,15 @@ class EntryActions {
if (subscription?.view) {
draft.entryIdByView[subscription.view].add(entry.id)
}

if (subscription?.category) {
let entryIdSetByCategory = draft.entryIdByCategory[subscription.category]
if (!entryIdSetByCategory) {
entryIdSetByCategory = new Set<EntryId>()
draft.entryIdByCategory[subscription.category] = entryIdSetByCategory
}
entryIdSetByCategory.add(entry.id)
}
}

if (inboxHandle) {
Expand Down

0 comments on commit 43e5c64

Please sign in to comment.