From 4ef5d93c4ffac56214f06def8de5a018e5c794f6 Mon Sep 17 00:00:00 2001 From: Max Ehrlicher-Schmidt Date: Fri, 18 Dec 2020 09:56:15 +0100 Subject: [PATCH] Fix loading in table --- src/app/components/table/table.component.html | 6 +++--- src/app/components/table/table.component.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/components/table/table.component.html b/src/app/components/table/table.component.html index 51bc0e4..7a236c4 100644 --- a/src/app/components/table/table.component.html +++ b/src/app/components/table/table.component.html @@ -20,7 +20,7 @@ class="table-control-button" matTooltip="Tabllendaten aktualisieren. Achtung! Alle ungespeicherten Ă„nderungen gehen verloren." (click)="reloadTable()" - [disabled]="reloadingTable" + [disabled]="reloadingTable || !isLoaded" > sync @@ -76,7 +76,7 @@ cdkDropListOrientation="horizontal" (cdkDropListDropped)="drop($event)" [dataSource]="data" - [ngClass]="{ 'idle-overlay': !isLoaded }" + [ngClass]="{ 'idle-overlay': !isLoaded || reloadingTable }" > @@ -383,7 +383,7 @@ > diff --git a/src/app/components/table/table.component.ts b/src/app/components/table/table.component.ts index c323a5b..74ec8cc 100644 --- a/src/app/components/table/table.component.ts +++ b/src/app/components/table/table.component.ts @@ -164,14 +164,14 @@ export class TableComponent implements AfterViewInit { this.dataService.tableData.subscribe((newTableDataSource) => { const tempDataSource = []; - this.isLoaded = true; - this.reloadingTable = false; - this.loadingErrorOccurred = false; if (newTableDataSource == null) { this.data.data = []; - this.loadingErrorOccurred = true; + this.loadingErrorOccurred = false; return; } + this.isLoaded = true; + this.reloadingTable = false; + this.loadingErrorOccurred = false; for (const row of newTableDataSource) { if (row.newObject) { // its a copied object