@ai-matrx/records-ui 0.115.95 → 0.115.96

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/pickers.cjs CHANGED
@@ -8170,11 +8170,14 @@ function ButtonValue({ field, recordId, inCell }) {
8170
8170
  const tableId = field.entity_definition_id;
8171
8171
  const press = async () => {
8172
8172
  if (!client || !recordId) return setSaid({ kind: "public" });
8173
- if (needs) return setSaid({ kind: "needs", says: needs });
8173
+ if (needs && b.do) return setSaid({ kind: "needs", says: needs });
8174
8174
  setBusy(true);
8175
8175
  const answered = await client.buttonPress({ record_id: recordId, field_id: field.id });
8176
8176
  setBusy(false);
8177
- if (!answered.ok) return setSaid({ kind: "refused", error: answered.error });
8177
+ if (!answered.ok) {
8178
+ if (needs && (answered.error.sqlstate === "22023" || answered.error.code === "invalid_argument")) return setSaid({ kind: "needs", says: needs });
8179
+ return setSaid({ kind: "refused", error: answered.error });
8180
+ }
8178
8181
  const pressed = answered.data;
8179
8182
  if (pressed.do === "open_url") {
8180
8183
  const opened = typeof window !== "undefined" ? (0, import_outbound.openOutbound)(pressed.url, "_blank", "noopener") : null;