mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
guard board switching in board context menu
This commit is contained in:
parent
87424be95d
commit
26ef5249b1
@ -25,14 +25,17 @@ const BoardContextMenu = memo(
|
|||||||
|
|
||||||
const selector = useMemo(
|
const selector = useMemo(
|
||||||
() =>
|
() =>
|
||||||
createSelector(stateSelector, ({ gallery }) => {
|
createSelector(stateSelector, ({ gallery, system }) => {
|
||||||
const isAutoAdd = gallery.autoAddBoardId === board_id;
|
const isAutoAdd = gallery.autoAddBoardId === board_id;
|
||||||
return { isAutoAdd };
|
const isProcessing = system.isProcessing;
|
||||||
|
const autoAssignBoardOnClick = gallery.autoAssignBoardOnClick;
|
||||||
|
return { isAutoAdd, isProcessing, autoAssignBoardOnClick };
|
||||||
}),
|
}),
|
||||||
[board_id]
|
[board_id]
|
||||||
);
|
);
|
||||||
|
|
||||||
const { isAutoAdd } = useAppSelector(selector);
|
const { isAutoAdd, isProcessing, autoAssignBoardOnClick } =
|
||||||
|
useAppSelector(selector);
|
||||||
const boardName = useBoardName(board_id);
|
const boardName = useBoardName(board_id);
|
||||||
|
|
||||||
const handleSetAutoAdd = useCallback(() => {
|
const handleSetAutoAdd = useCallback(() => {
|
||||||
@ -59,7 +62,7 @@ const BoardContextMenu = memo(
|
|||||||
<MenuGroup title={boardName}>
|
<MenuGroup title={boardName}>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={<FaPlus />}
|
icon={<FaPlus />}
|
||||||
isDisabled={isAutoAdd}
|
isDisabled={isAutoAdd || isProcessing || autoAssignBoardOnClick}
|
||||||
onClick={handleSetAutoAdd}
|
onClick={handleSetAutoAdd}
|
||||||
>
|
>
|
||||||
Auto-add to this Board
|
Auto-add to this Board
|
||||||
|
Loading…
Reference in New Issue
Block a user