fix(desktop): excludePrivate not working for local change
This commit is contained in:
@@ -25,12 +25,18 @@ export const getSubscriptionByEntryId = (entryId: string | undefined) => {
|
||||
|
||||
export const getSubscribedFeedIdAndInboxHandlesByView = (
|
||||
view: FeedViewType | undefined,
|
||||
excludePrivate: boolean,
|
||||
): string[] => {
|
||||
if (typeof view !== "number") return []
|
||||
const state = useSubscriptionStore.getState()
|
||||
return Array.from(state.feedIdByView[view])
|
||||
.filter((i) => !excludePrivate || !state.data[i]?.isPrivate)
|
||||
.concat(view === FeedViewType.Articles ? getInboxList().map((i) => i.id) : [])
|
||||
.concat(Array.from(state.listIdByView[view]).flatMap((id) => getListFeedIds(id) ?? []))
|
||||
.concat(
|
||||
Array.from(state.listIdByView[view])
|
||||
.filter((i) => !excludePrivate || !state.data[i]?.isPrivate)
|
||||
.flatMap((id) => getListFeedIds(id) ?? []),
|
||||
)
|
||||
}
|
||||
|
||||
export const getSubscribedFeedIdsByView = (view: FeedViewType): string[] => {
|
||||
|
||||
@@ -143,7 +143,7 @@ class UnreadSyncService {
|
||||
} else if (filter?.inboxId) {
|
||||
await this.updateUnreadStatus({ ids: [filter.inboxId], time, request })
|
||||
} else {
|
||||
const feedIdAndInboxHandles = getSubscribedFeedIdAndInboxHandlesByView(view)
|
||||
const feedIdAndInboxHandles = getSubscribedFeedIdAndInboxHandlesByView(view, excludePrivate)
|
||||
await this.updateUnreadStatus({ ids: feedIdAndInboxHandles, time, request })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user