mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
feat(ui): use useAssertSingleton for all singleton modals
footgun insurance
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { ConfirmationAlertDialog, Text } from '@invoke-ai/ui-library';
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { useAssertSingleton } from 'common/hooks/useAssertSingleton';
|
||||
import { toast } from 'features/toast/toast';
|
||||
import { atom } from 'nanostores';
|
||||
import { useCallback } from 'react';
|
||||
@@ -19,6 +20,7 @@ export const useDeleteWorkflow = () => {
|
||||
};
|
||||
|
||||
export const DeleteWorkflowDialog = () => {
|
||||
useAssertSingleton('DeleteWorkflowDialog');
|
||||
const { t } = useTranslation();
|
||||
const workflowToDelete = useStore($workflowToDelete);
|
||||
const [_deleteWorkflow] = useDeleteWorkflowMutation();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ConfirmationAlertDialog, Flex, Text } from '@invoke-ai/ui-library';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import { useAssertSingleton } from 'common/hooks/useAssertSingleton';
|
||||
import { buildUseDisclosure } from 'common/hooks/useBoolean';
|
||||
import { nodeEditorReset } from 'features/nodes/store/nodesSlice';
|
||||
import { selectWorkflowIsTouched, workflowModeChanged } from 'features/nodes/store/workflowSlice';
|
||||
@@ -43,6 +44,7 @@ export const useNewWorkflow = () => {
|
||||
};
|
||||
|
||||
export const NewWorkflowConfirmationAlertDialog = memo(() => {
|
||||
useAssertSingleton('NewWorkflowConfirmationAlertDialog');
|
||||
const { t } = useTranslation();
|
||||
const dialog = useDialogState();
|
||||
const newWorkflow = useNewWorkflow();
|
||||
|
||||
Reference in New Issue
Block a user