Skip to content

Commit

Permalink
Adjust column collection condition
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Nov 25, 2024
1 parent ddd8842 commit b311536
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/store/columnsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function useColumnsStore() {
for (const track of tracks) {
for (const key of keys) {
const column = track[key];
if (column !== undefined && ![...columnsList, ...SPECIAL_KEYS].includes(column)) {
if (column && ![...columnsList, ...SPECIAL_KEYS].includes(column)) {
columnsList.push(column);
}
}
Expand All @@ -28,7 +28,6 @@ export function useColumnsStore() {
columns.value[datasetId] = columns.value[datasetId] || {};
const columnsAvailable = Object.keys(columns.value[datasetId]);
const columnsList = getColumns(tracks, keys).filter((x) => !columnsAvailable.includes(x));

if (columnsList.length > 0) {
const columnsData = await datasetsGetColumns(datasetId, columnsList);
if (columnsData) {
Expand All @@ -43,7 +42,7 @@ export function useColumnsStore() {
const trackEntry: Record<string, any> = {};
keys.forEach((key) => {
const column = track[key];
if (column !== undefined && !SPECIAL_KEYS.includes(column)) {
if (column && !SPECIAL_KEYS.includes(column)) {
trackEntry[key] = columns.value[datasetId][column];
}
});
Expand Down

0 comments on commit b311536

Please sign in to comment.