@superleapai/flow-ui 2.5.21 → 2.6.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.
- package/core/crm.js +9 -9
- package/dist/superleap-flow.min.js +2 -2
- package/index.d.ts +5 -4
- package/index.js +2 -2
- package/package.json +1 -1
package/core/crm.js
CHANGED
|
@@ -248,17 +248,18 @@
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
/**
|
|
251
|
-
*
|
|
252
|
-
* The CRM
|
|
253
|
-
* (e.g. close the form, refresh data, show a toast).
|
|
251
|
+
* Register a callback for when the CRM form is submitted successfully.
|
|
252
|
+
* The CRM sends a 'crm:formSubmitSuccess' message after the form saves.
|
|
254
253
|
*
|
|
255
|
-
* @param {
|
|
254
|
+
* @param {Function} callback – receives (payload)
|
|
255
|
+
* @returns {Function} unsubscribe function
|
|
256
256
|
*/
|
|
257
|
-
function
|
|
257
|
+
function onFormSubmitSuccess(callback) {
|
|
258
258
|
var bridge = getBridge();
|
|
259
|
-
if (bridge
|
|
260
|
-
|
|
259
|
+
if (!bridge) {
|
|
260
|
+
return function () {};
|
|
261
261
|
}
|
|
262
|
+
return bridge.onMessage("crm:onFormSubmitSuccess", callback);
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
// ---------------------------------------------------------------------------
|
|
@@ -335,8 +336,7 @@
|
|
|
335
336
|
global.superleapClient.disconnect = disconnect;
|
|
336
337
|
global.superleapClient.setLoading = setLoading;
|
|
337
338
|
global.superleapClient.closeForm = closeForm;
|
|
338
|
-
global.superleapClient.
|
|
339
|
-
formSubmittedSuccessfully;
|
|
339
|
+
global.superleapClient.onFormSubmitSuccess = onFormSubmitSuccess;
|
|
340
340
|
global.superleapClient.toast = toast;
|
|
341
341
|
global.superleapClient.navigate = navigate;
|
|
342
342
|
global.superleapClient.getContext = getContext;
|