@nocobase/flow-engine 2.1.0-alpha.30 → 2.1.0-alpha.32

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.
@@ -26,6 +26,10 @@ function encodeFilterByTk(val: SharedViewParam['filterByTk']): string {
26
26
  return encodeURIComponent(String(val));
27
27
  }
28
28
 
29
+ function hasUsableSourceId(sourceId: unknown): sourceId is string | number {
30
+ return sourceId !== undefined && sourceId !== null && String(sourceId) !== '';
31
+ }
32
+
29
33
  /**
30
34
  * 将 ViewParam 数组转换为 pathname
31
35
  *
@@ -65,8 +69,8 @@ export function generatePathnameFromViewParams(viewParams: ViewParams[]): string
65
69
  segments.push('filterbytk', encoded);
66
70
  }
67
71
  }
68
- if (viewParam.sourceId) {
69
- segments.push('sourceid', viewParam.sourceId);
72
+ if (hasUsableSourceId(viewParam.sourceId)) {
73
+ segments.push('sourceid', String(viewParam.sourceId));
70
74
  }
71
75
  });
72
76