From eb5e01cda9fcee0c86f6faf72b9004880ca8dbb0 Mon Sep 17 00:00:00 2001 From: Christoph Anderson Date: Thu, 14 Sep 2023 20:17:47 +0200 Subject: [PATCH] No double call of setState() needed --- src/SourcesTable.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/SourcesTable.jsx b/src/SourcesTable.jsx index f84c391..db3ebe0 100644 --- a/src/SourcesTable.jsx +++ b/src/SourcesTable.jsx @@ -44,8 +44,7 @@ export class SourcesTable extends Component { componentDidMount() { const { defaultSnapshotViewAll } = this.context; - this.setState({ isLoading: true }); - this.setState({ selectedOwner: defaultSnapshotViewAll ? allSnapshots : localSnapshots }); + this.setState({ isLoading: true, selectedOwner: defaultSnapshotViewAll ? allSnapshots : localSnapshots }); this.fetchSourcesWithoutSpinner(); this.interval = window.setInterval(this.fetchSourcesWithoutSpinner, 3000); }