@stonecrop/desktop 0.10.7 → 0.10.8

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/dist/desktop.js CHANGED
@@ -1929,8 +1929,9 @@ class Sa {
1929
1929
  getRecordState(e, r) {
1930
1930
  const n = typeof e == "string" ? e : e.slug, o = this.registry.getDoctype(n);
1931
1931
  if (!o?.workflow) return "";
1932
- const i = this.getRecordById(n, r)?.get("status"), a = typeof o.workflow.initial == "string" ? o.workflow.initial : Object.keys(o.workflow.states ?? {})[0] ?? "";
1933
- return i || a;
1932
+ const i = this.getRecordById(n, r)?.get("status"), a = o.workflow;
1933
+ let s;
1934
+ return Array.isArray(a.states) ? s = a.states[0] ?? "" : s = typeof a.initial == "string" ? a.initial : Object.keys(a.states ?? {})[0] ?? "", i || s;
1934
1935
  }
1935
1936
  }
1936
1937
  function Ia(t) {