Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Domenico Gemoli <dgemoli@redcross.nl>
  • Loading branch information
PeterSmallenbroek and aberonni committed Jan 20, 2025
1 parent 07f4586 commit ae6e925
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class QueryTableComponent<TData extends { id: PropertyKey }, TContext> {

selectedColumnsStateKey = computed(() => {
const key = this.localStorageKey();
return key ? `${key}-selected-columns` : 'selected-columns';
return key ? `${key}-selected-columns` : undefined;
});

/**
Expand Down Expand Up @@ -501,13 +501,8 @@ export class QueryTableComponent<TData extends { id: PropertyKey }, TContext> {
const interpretedColumns = JSON.parse(
storedSelectedColumns,
) as QueryTableColumn<TData>[];
console.log(
'🚀 ~ QueryTableComponent<TData ~ resetColumnVisibility ~ interpretedColumns:',
interpretedColumns,
);
const matchedColumns = interpretedColumns
.map((column) => this.columns().find((c) => c.field === column.field))
.filter(Boolean) as QueryTableColumn<TData>[];
.filter((column) => !!this.columns().find((c) => c.field === column.field)) as QueryTableColumn<TData>[];
this.visibleColumns.set(matchedColumns);
} else {
this.visibleColumns.set(
Expand Down

0 comments on commit ae6e925

Please sign in to comment.