Connecting a database no longer freezes the page: the columns field keeps one empty list

This commit is contained in:
Roberto Treviño
2026-11-30 05:17:14 -06:00
parent ffa732df12
commit 053679c817
2 changed files with 5 additions and 4 deletions
+4 -2
View File
@@ -33,6 +33,8 @@ export interface SourceDialogData {
guided?: Guided | null;
label?: string;
}
const NONE: string[] = [];
/** What it gives back: the dialog's answers (the node's dlt fields are made from them). */
export interface SourceDialogResult {
guided: Guided;
@@ -203,17 +205,17 @@ export class SourceDialog {
}
}
/** The tables a database listed, for its table field. */
/** A list answer (the columns picked), as a list. */
protected listed(name: string): string[] {
const v = this.value(name);
return Array.isArray(v) ? (v as string[]) : [];
return Array.isArray(v) ? (v as string[]) : NONE; // a new list each time renders forever
}
/** The columns to pick from: the first rows', and those already picked. */
protected columnOptions(name: string): string[] {
return [...new Set([...this.columns(), ...this.listed(name)])];
}
/** The tables a database listed, for its table field. */
protected tables(): string[] {
return this.tableList();
}