Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

change at nocodb-sdk too

Fendy Heryanto13dcdb6ffa41
diff --git a/packages/nocodb-sdk/src/lib/stringHelpers.ts b/packages/nocodb-sdk/src/lib/stringHelpers.ts
index 9d2e0822da..2ad9cb8a02 100644
--- a/packages/nocodb-sdk/src/lib/stringHelpers.ts
+++ b/packages/nocodb-sdk/src/lib/stringHelpers.ts
@@ -1,3 +1,4 @@
+import { v4 as uuidv4 } from 'uuid';
import { ncIsUndefined } from './is';
const AppendToLengthSuffixConfig = {
@@ -194,3 +195,11 @@ export function stringAllMatches(
return matches;
}
+
+export function generateRandomUuid() {
+ if (crypto?.randomUUID && typeof crypto.randomUUID === 'function') {
+ return crypto.randomUUID();
+ }
+
+ return uuidv4();
+}
diff --git a/packages/nocodb-sdk/src/lib/workflow/constants.ts b/packages/nocodb-sdk/src/lib/workflow/constants.ts
index c871ce93e2..85847d4de5 100644
--- a/packages/nocodb-sdk/src/lib/workflow/constants.ts
+++ b/packages/nocodb-sdk/src/lib/workflow/constants.ts
@@ -1,3 +1,4 @@
+import { generateRandomUuid } from '~/lib/stringHelpers';
import { WorkflowNodeCategory, WorkflowNodeDefinition } from './node';
export const GeneralNodeID = {
@@ -55,7 +56,7 @@ export const GENERAL_DEFAULT_NODES: WorkflowNodeDefinition[] = [
const initWorkflowNodes = [
{
- id: crypto.randomUUID(),
+ id: generateRandomUuid(),
type: GeneralNodeID.TRIGGER,
position: { x: 250, y: 50 },
data: {