Skip to content

Commit

Permalink
dashboard fix: check if selected tables found
Browse files Browse the repository at this point in the history
  • Loading branch information
lyubov-voloshko committed Sep 13, 2023
1 parent 8fb9c0f commit 8ea79a9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/src/app/components/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import { HttpErrorResponse } from '@angular/common/http';
import { MatDialog } from '@angular/material/dialog';
import { NotificationsService } from 'src/app/services/notifications.service';
import { SelectionModel } from '@angular/cdk/collections';
import { ServerError } from 'src/app/models/alert';
import { TableRowService } from 'src/app/services/table-row.service';
import { TablesDataSource } from './db-tables-data-source';
import { TablesService } from 'src/app/services/tables.service';
import { Title } from '@angular/platform-browser';
import { User } from 'src/app/models/user';
import { normalizeTableName } from '../../lib/normalize'
import { omitBy } from "lodash";
import { ServerError } from 'src/app/models/alert';

interface DataToActivateActions {
action: CustomAction,
Expand Down Expand Up @@ -177,7 +177,11 @@ export class DashboardComponent implements OnInit {
})

const selectedTableProperties = this.tablesList.find( (table: any) => table.table == this.selectedTableName);
this.selectedTableDisplayName = selectedTableProperties.display_name || normalizeTableName(selectedTableProperties.table);
if (selectedTableProperties) {
this.selectedTableDisplayName = selectedTableProperties.display_name || normalizeTableName(selectedTableProperties.table);
} else {
return;
}
this.loading = false;
}

Expand Down

0 comments on commit 8ea79a9

Please sign in to comment.