Jon/sky 5820 make browser task block flippable with code (#3165)
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { DeleteNodeCallbackContext } from "@/store/DeleteNodeCallbackContext";
|
||||
import { BlockActionContext } from "@/store/BlockActionContext";
|
||||
import { useContext } from "react";
|
||||
|
||||
function useDeleteNodeCallback() {
|
||||
const deleteNodeCallback = useContext(DeleteNodeCallbackContext);
|
||||
const deleteNodeCallback = useContext(BlockActionContext)?.deleteNodeCallback;
|
||||
|
||||
if (!deleteNodeCallback) {
|
||||
throw new Error(
|
||||
"useDeleteNodeCallback must be used within a DeleteNodeCallbackProvider",
|
||||
"useDeleteNodeCallback must be used within a BlockActionContextProvider",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user