mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
remove actions we can get from mutation data
This commit is contained in:
parent
4f95c077d4
commit
dbd6c9c6ed
@ -5,7 +5,6 @@ import {
|
|||||||
controlAdapterImageChanged,
|
controlAdapterImageChanged,
|
||||||
controlAdapterIsEnabledChanged,
|
controlAdapterIsEnabledChanged,
|
||||||
} from 'features/controlAdapters/store/controlAdaptersSlice';
|
} from 'features/controlAdapters/store/controlAdaptersSlice';
|
||||||
import { imageUploaded } from 'features/gallery/store/actions';
|
|
||||||
import { fieldImageValueChanged } from 'features/nodes/store/nodesSlice';
|
import { fieldImageValueChanged } from 'features/nodes/store/nodesSlice';
|
||||||
import {
|
import {
|
||||||
initialImageChanged,
|
initialImageChanged,
|
||||||
@ -41,8 +40,6 @@ export const addImageUploadedFulfilledListener = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch(imageUploaded({ postUploadAction: postUploadAction?.type }));
|
|
||||||
|
|
||||||
const DEFAULT_UPLOADED_TOAST: UseToastOptions = {
|
const DEFAULT_UPLOADED_TOAST: UseToastOptions = {
|
||||||
title: t('toast.imageUploaded'),
|
title: t('toast.imageUploaded'),
|
||||||
status: 'success',
|
status: 'success',
|
||||||
|
@ -5,7 +5,6 @@ import { InvContextMenu } from 'common/components/InvContextMenu/InvContextMenu'
|
|||||||
import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem';
|
import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem';
|
||||||
import { InvMenuList } from 'common/components/InvMenu/InvMenuList';
|
import { InvMenuList } from 'common/components/InvMenu/InvMenuList';
|
||||||
import { InvMenuGroup } from 'common/components/InvMenu/wrapper';
|
import { InvMenuGroup } from 'common/components/InvMenu/wrapper';
|
||||||
import { bulkDownloadRequested } from 'features/gallery/store/actions';
|
|
||||||
import {
|
import {
|
||||||
autoAddBoardIdChanged,
|
autoAddBoardIdChanged,
|
||||||
selectGallerySlice,
|
selectGallerySlice,
|
||||||
@ -67,8 +66,6 @@ const BoardContextMenu = ({
|
|||||||
board_id: board_id,
|
board_id: board_id,
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
|
|
||||||
dispatch(bulkDownloadRequested({ type: 'board' }));
|
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
addToast({
|
addToast({
|
||||||
title: t('gallery.preparingDownload'),
|
title: t('gallery.preparingDownload'),
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import { useAppDispatch } from 'app/store/storeHooks';
|
|
||||||
import { InvIconButton } from 'common/components/InvIconButton/InvIconButton';
|
import { InvIconButton } from 'common/components/InvIconButton/InvIconButton';
|
||||||
import { boardCreated } from 'features/gallery/store/actions';
|
|
||||||
import { memo, useCallback } from 'react';
|
import { memo, useCallback } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { PiPlusBold } from 'react-icons/pi';
|
import { PiPlusBold } from 'react-icons/pi';
|
||||||
@ -9,13 +7,10 @@ import { useCreateBoardMutation } from 'services/api/endpoints/boards';
|
|||||||
const AddBoardButton = () => {
|
const AddBoardButton = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [createBoard, { isLoading }] = useCreateBoardMutation();
|
const [createBoard, { isLoading }] = useCreateBoardMutation();
|
||||||
const dispatch = useAppDispatch();
|
|
||||||
|
|
||||||
const DEFAULT_BOARD_NAME = t('boards.myBoard');
|
const DEFAULT_BOARD_NAME = t('boards.myBoard');
|
||||||
const handleCreateBoard = useCallback(async () => {
|
const handleCreateBoard = useCallback(() => {
|
||||||
await createBoard(DEFAULT_BOARD_NAME).unwrap();
|
createBoard(DEFAULT_BOARD_NAME);
|
||||||
dispatch(boardCreated());
|
}, [createBoard, DEFAULT_BOARD_NAME]);
|
||||||
}, [createBoard, DEFAULT_BOARD_NAME, dispatch]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<InvIconButton
|
<InvIconButton
|
||||||
|
@ -8,7 +8,6 @@ import {
|
|||||||
isModalOpenChanged,
|
isModalOpenChanged,
|
||||||
} from 'features/changeBoardModal/store/slice';
|
} from 'features/changeBoardModal/store/slice';
|
||||||
import { imagesToDeleteSelected } from 'features/deleteImageModal/store/slice';
|
import { imagesToDeleteSelected } from 'features/deleteImageModal/store/slice';
|
||||||
import { bulkDownloadRequested } from 'features/gallery/store/actions';
|
|
||||||
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
||||||
import { addToast } from 'features/system/store/systemSlice';
|
import { addToast } from 'features/system/store/systemSlice';
|
||||||
import { memo, useCallback, useMemo } from 'react';
|
import { memo, useCallback, useMemo } from 'react';
|
||||||
@ -62,8 +61,6 @@ const MultipleSelectionMenuItems = () => {
|
|||||||
image_names: selection.map((img) => img.image_name),
|
image_names: selection.map((img) => img.image_name),
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
|
|
||||||
dispatch(bulkDownloadRequested({ type: 'images' }));
|
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
addToast({
|
addToast({
|
||||||
title: t('gallery.preparingDownload'),
|
title: t('gallery.preparingDownload'),
|
||||||
|
@ -15,12 +15,3 @@ export const requestedBoardImagesDeletion =
|
|||||||
export const sentImageToCanvas = createAction('gallery/sentImageToCanvas');
|
export const sentImageToCanvas = createAction('gallery/sentImageToCanvas');
|
||||||
|
|
||||||
export const sentImageToImg2Img = createAction('gallery/sentImageToImg2Img');
|
export const sentImageToImg2Img = createAction('gallery/sentImageToImg2Img');
|
||||||
|
|
||||||
export const imageUploaded = createAction<{ postUploadAction?: string }>(
|
|
||||||
'gallery/imageUploaded'
|
|
||||||
);
|
|
||||||
export const boardCreated = createAction('gallery/boardCreated');
|
|
||||||
|
|
||||||
export const bulkDownloadRequested = createAction<{ type: string }>(
|
|
||||||
'gallery/bulkDownloadRequested'
|
|
||||||
);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user