Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: TT-283 added try catch to handle method rerenderDataTable
  • Loading branch information
kevinjlope committed Jul 6, 2021
commit 89b3e6404288088c18ce3c33c70710c7a9415a6d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { formatDate } from '@angular/common';
import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
import { select, Store } from '@ngrx/store';
import { DataTableDirective } from 'angular-datatables';
import * as console from 'console';
import * as moment from 'moment';
import { Observable, Subject } from 'rxjs';
import { Entry } from 'src/app/modules/shared/models';
Expand Down Expand Up @@ -82,11 +83,15 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
private rerenderDataTable(): void {
if (this.dtElement && this.dtElement.dtInstance) {
this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
dtInstance.destroy();
this.dtTrigger.next();
try {
dtInstance.destroy();
this.dtTrigger.next();
} catch (error) {}
});
} else {
this.dtTrigger.next();
try {
this.dtTrigger.next();
} catch (error) {}
}
}

Expand Down