show affected blocks in confirmation dialog when deleting blocks or parameters (#4519)
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import { BlockActionContext } from "@/store/BlockActionContext";
|
||||
import { useContext } from "react";
|
||||
|
||||
function useDeleteNodeCallback() {
|
||||
const deleteNodeCallback = useContext(BlockActionContext)?.deleteNodeCallback;
|
||||
|
||||
if (!deleteNodeCallback) {
|
||||
throw new Error(
|
||||
"useDeleteNodeCallback must be used within a BlockActionContextProvider",
|
||||
);
|
||||
}
|
||||
|
||||
return deleteNodeCallback;
|
||||
}
|
||||
|
||||
export { useDeleteNodeCallback };
|
||||
@@ -0,0 +1,17 @@
|
||||
import { BlockActionContext } from "@/store/BlockActionContext";
|
||||
import { useContext } from "react";
|
||||
|
||||
function useRequestDeleteNodeCallback() {
|
||||
const requestDeleteNodeCallback =
|
||||
useContext(BlockActionContext)?.requestDeleteNodeCallback;
|
||||
|
||||
if (!requestDeleteNodeCallback) {
|
||||
throw new Error(
|
||||
"useRequestDeleteNodeCallback must be used within a BlockActionContextProvider",
|
||||
);
|
||||
}
|
||||
|
||||
return requestDeleteNodeCallback;
|
||||
}
|
||||
|
||||
export { useRequestDeleteNodeCallback };
|
||||
Reference in New Issue
Block a user