Skip to content

Commit

Permalink
feat: filter adding feeds to lists in lists context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Sep 26, 2024
1 parent afb79a2 commit f96cf01
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
43 changes: 23 additions & 20 deletions apps/renderer/src/hooks/biz/useFeedActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,29 @@ export const useFeedActions = ({
type: "separator" as const,
disabled: isEntryList,
},
{
type: "text" as const,
label: t("sidebar.feed_column.context_menu.add_feeds_to_list"),
enabled: !!listList.data?.length,
submenu: listList.data?.map((list) => ({
label: list.title || "",
type: "text",
icon: list.image,
click() {
return addMutation.mutate({
feedId,
listId: list.id,
})
},
})),
},
{
type: "separator" as const,
disabled: isEntryList,
},
...(!isList
? [
{
type: "text" as const,
label: t("sidebar.feed_column.context_menu.add_feeds_to_list"),
enabled: !!listList.data?.length,
submenu: listList.data?.map((list) => ({
label: list.title || "",
type: "text" as const,
click() {
return addMutation.mutate({
feedId,
listId: list.id,
})
},
})),
},
{
type: "separator" as const,
disabled: isEntryList,
},
]
: []),
{
type: "text" as const,
label: isEntryList ? t("sidebar.feed_actions.edit_feed") : t("sidebar.feed_actions.edit"),
Expand Down
1 change: 0 additions & 1 deletion apps/renderer/src/modules/feed-column/category.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ function FeedCategoryImpl({
submenu: listList.data?.map((list) => ({
label: list.title || "",
type: "text",
icon: list.image,
click() {
return addMutation.mutate({
feedIds: ids,
Expand Down

0 comments on commit f96cf01

Please sign in to comment.