feat: filter adding feeds to lists in lists context menu

This commit is contained in:
DIYgod 2024-09-27 01:24:14 +08:00
parent afb79a27fb
commit f96cf01bde
No known key found for this signature in database
2 changed files with 23 additions and 21 deletions

View File

@ -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"),

View File

@ -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,