fix(components): only override columns if prefs found

Before this, it didn't matter if a column had show = false as
it would default to be show if preferences weren't found.
This commit is contained in:
Steven Nguyen committed 2024-02-29 20:37:01 -08:00
1 parent 4769c50189
commit 86af600143
1 file changed
+9 -6
+9 -6
View File
@@ -31,12 +31,15 @@
} else {
const prefs = preferences.get($page.route);
columns.set(
$columns.map((column) => {
column.show = prefs.columns?.includes(column.id) ?? true;
return column;
})
);
// Override the shown columns only if a preference was set
if (prefs?.columns) {
columns.set(
$columns.map((column) => {
column.show = prefs.columns?.includes(column.id) ?? true;
return column;
})
);
}
}
columns.subscribe((ctx) => {