Refactor: Add pop up when saving node with ctrl s
This commit is contained in:
parent
933318a048
commit
010d654c23
1 changed files with 5 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ import {
|
||||||
updateFlowPosition,
|
updateFlowPosition,
|
||||||
} from "../../../../utils/reactflowUtils";
|
} from "../../../../utils/reactflowUtils";
|
||||||
import { classNames, cn } from "../../../../utils/utils";
|
import { classNames, cn } from "../../../../utils/utils";
|
||||||
|
import useAlertStore from "../../../../stores/alertStore";
|
||||||
|
|
||||||
export default function NodeToolbarComponent({
|
export default function NodeToolbarComponent({
|
||||||
data,
|
data,
|
||||||
|
|
@ -95,6 +96,9 @@ export default function NodeToolbarComponent({
|
||||||
const setLastCopiedSelection = useFlowStore(
|
const setLastCopiedSelection = useFlowStore(
|
||||||
(state) => state.setLastCopiedSelection
|
(state) => state.setLastCopiedSelection
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const setSuccessData = useAlertStore(state => state.setSuccessData);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFlowComponent(createFlowComponent(cloneDeep(data), version));
|
setFlowComponent(createFlowComponent(cloneDeep(data), version));
|
||||||
}, [
|
}, [
|
||||||
|
|
@ -283,6 +287,7 @@ export default function NodeToolbarComponent({
|
||||||
) {
|
) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
saveComponent(cloneDeep(data), false);
|
saveComponent(cloneDeep(data), false);
|
||||||
|
setSuccessData({title: `${data.id} saved successfully`})
|
||||||
unselectAll();
|
unselectAll();
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue