@ai-matrx/records-ui 0.115.95 → 0.115.97

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.js CHANGED
@@ -8244,11 +8244,14 @@ function ButtonValue({ field, recordId, inCell }) {
8244
8244
  const tableId = field.entity_definition_id;
8245
8245
  const press = async () => {
8246
8246
  if (!client || !recordId) return setSaid({ kind: "public" });
8247
- if (needs) return setSaid({ kind: "needs", says: needs });
8247
+ if (needs && b.do) return setSaid({ kind: "needs", says: needs });
8248
8248
  setBusy(true);
8249
8249
  const answered = await client.buttonPress({ record_id: recordId, field_id: field.id });
8250
8250
  setBusy(false);
8251
- if (!answered.ok) return setSaid({ kind: "refused", error: answered.error });
8251
+ if (!answered.ok) {
8252
+ if (needs && (answered.error.sqlstate === "22023" || answered.error.code === "invalid_argument")) return setSaid({ kind: "needs", says: needs });
8253
+ return setSaid({ kind: "refused", error: answered.error });
8254
+ }
8252
8255
  const pressed = answered.data;
8253
8256
  if (pressed.do === "open_url") {
8254
8257
  const opened = typeof window !== "undefined" ? openOutbound(pressed.url, "_blank", "noopener") : null;