flow-lib-creomnia 1.0.16-dev.2 → 1.0.17-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -47,8 +47,13 @@ const NodeSettingsProvider = ({ children, permissions: { canUpdate, canDelete },
|
|
|
47
47
|
setInternalNodeBase(null);
|
|
48
48
|
}, config_1.Config.CLEAR_NODE_DELAY);
|
|
49
49
|
};
|
|
50
|
-
const onSaveNode = () => {
|
|
51
|
-
|
|
50
|
+
const onSaveNode = async () => {
|
|
51
|
+
// `onSave` is allowed to be sync OR async — host apps that wrap a
|
|
52
|
+
// server call in an async handler need to surface validation errors
|
|
53
|
+
// BEFORE the drawer closes. Awaiting handles both cases: a sync
|
|
54
|
+
// `false` short-circuits, a `Promise<false>` resolves and short-
|
|
55
|
+
// circuits, anything else closes the drawer.
|
|
56
|
+
const result = await node?.settings?.footer?.onSave?.(node?.id);
|
|
52
57
|
if (result === false)
|
|
53
58
|
return;
|
|
54
59
|
handleClose();
|