@ai-matrx/records-ui 0.110.10 → 0.110.12

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.
@@ -1272,13 +1272,13 @@ async function askTablePageSeed(input) {
1272
1272
  const unversioned = page.data.rows.filter((row) => ownVersion(row) === null).map((row) => row.id);
1273
1273
  if (unversioned.length > 0) reads.push(client.recordHeaders({ ids: unversioned }));
1274
1274
  reads.push(
1275
- client.reverseColumns({ table_id: input.tableId }).then(
1276
- (columns) => columns.ok ? Promise.all(
1277
- columns.data.map(
1278
- (c) => client.reverseLinksMany({ table_id: input.tableId, source_field_id: c.source_field_id, record_ids: page.data.rows.map((row) => row.id), limit: REVERSE_CELL_CHIPS })
1279
- )
1280
- ) : null
1281
- )
1275
+ client.reverseColumns({ table_id: input.tableId }).then(async (columns) => {
1276
+ if (!columns.ok || columns.data.length === 0) return null;
1277
+ const record_ids = page.data.rows.map((row) => row.id);
1278
+ const all = await client.reverseLinksFields({ table_id: input.tableId, source_field_ids: columns.data.map((c) => c.source_field_id), record_ids, limit: REVERSE_CELL_CHIPS });
1279
+ if (all.ok || all.error.code !== "door_absent") return null;
1280
+ return Promise.all(columns.data.map((c) => client.reverseLinksMany({ table_id: input.tableId, source_field_id: c.source_field_id, record_ids, limit: REVERSE_CELL_CHIPS })));
1281
+ })
1282
1282
  );
1283
1283
  await Promise.all(reads.map((read) => read.catch(() => null)));
1284
1284
  }