Improve subtable handling in data prep

This commit is contained in:
Oliver-Akins 2025-04-21 01:01:14 -06:00
parent 91863d85a8
commit 9eafba6165

View file

@ -90,9 +90,11 @@ export class StatsViewer extends HandlebarsApplicationMixin(ApplicationV2) {
ctx.tables = tableList; ctx.tables = tableList;
const subtableList = subtables[this._selectedTable]; const subtableList = subtables[this._selectedTable];
if (subtableList && !subtableList.includes(this._selectedSubtable)) { if (!subtableList) {
this._selectedSubtable = subtableList[0]; this._selectedSubtable = undefined;
} } else if (!subtableList.includes(this._selectedSubtable)) {
this._selectedSubtable = subtableList?.[0];
};
ctx.subtable = this._selectedSubtable; ctx.subtable = this._selectedSubtable;
ctx.subtables = subtableList; ctx.subtables = subtableList;
}; };