Skip to content

Commit

Permalink
fix: wrong opening status of newly added feed (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
Przeblysk authored Sep 30, 2024
1 parent b0a8831 commit 2520ddb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/renderer/src/modules/feed-column/category.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function FeedCategoryImpl({ data: ids, view, categoryOpenStateData }: FeedCatego
useEffect(() => {
if (shouldOpen) {
if (!open && view !== undefined && folderName) {
subscriptionActions.toggleCategoryOpenState(view, folderName)
subscriptionActions.changeCategoryOpenState(view, folderName, true)
}

const $items = itemsRef.current
Expand Down
8 changes: 8 additions & 0 deletions apps/renderer/src/store/subscription/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ class SubscriptionActions {
)
}

changeCategoryOpenState(view: FeedViewType, category: string, status: boolean) {
set((state) =>
produce(state, (state) => {
state.categoryOpenStateByView[view][category] = status
}),
)
}

expandCategoryOpenStateByView(view: FeedViewType, isOpen: boolean) {
set((state) =>
produce(state, (state) => {
Expand Down

0 comments on commit 2520ddb

Please sign in to comment.