feat: disable eagle for no image feed

This commit is contained in:
DIYgod 2024-05-16 22:51:36 +08:00
parent fbb27e2c2a
commit aa85395436
No known key found for this signature in database
2 changed files with 12 additions and 9 deletions

View File

@ -27,14 +27,16 @@ export function EntryContextMenu({
<ContextMenu>
<ContextMenuTrigger className="w-full">{children}</ContextMenuTrigger>
<ContextMenuContent onClick={(e) => e.stopPropagation()}>
{items[view].map((item) => (
<ContextMenuItem
key={item.name}
onClick={() => execAction(item.action)}
>
{item.name}
</ContextMenuItem>
))}
{items[view]
.filter((item) => !item.disabled)
.map((item) => (
<ContextMenuItem
key={item.name}
onClick={() => execAction(item.action)}
>
{item.name}
</ContextMenuItem>
))}
</ContextMenuContent>
</ContextMenu>
)

View File

@ -41,7 +41,8 @@ export const useEntryActions = ({
name: "Save Images to Eagle",
icon: "/eagle.svg",
action: "save-to-eagle",
disabled: checkEagle.isLoading ? true : !checkEagle.data,
disabled:
(checkEagle.isLoading ? true : !checkEagle.data) || !images?.length,
},
{
name: "Share",