From 78259f9dd216e00751f6b67a7bb315f95aa446d8 Mon Sep 17 00:00:00 2001 From: Philipp Otto Date: Wed, 21 Jun 2023 18:47:02 +0200 Subject: [PATCH] dont show placeholders in dashboard during loading --- frontend/javascripts/dashboard/dashboard_task_list_view.tsx | 3 +-- frontend/javascripts/dashboard/dataset_folder_view.tsx | 3 ++- .../javascripts/dashboard/explorative_annotations_view.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/javascripts/dashboard/dashboard_task_list_view.tsx b/frontend/javascripts/dashboard/dashboard_task_list_view.tsx index e4857b22ba0..3341b1c722d 100644 --- a/frontend/javascripts/dashboard/dashboard_task_list_view.tsx +++ b/frontend/javascripts/dashboard/dashboard_task_list_view.tsx @@ -177,8 +177,7 @@ class DashboardTaskListView extends React.PureComponent { }); } - // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'pageNumber' implicitly has an 'any' typ... Remove this comment to see the full error message - fetchNextPage = async (pageNumber) => { + fetchNextPage = async (pageNumber: number) => { // this refers not to the pagination of antd but to the pagination of querying data from SQL const isFinished = this.state.showFinishedTasks; const previousTasks = this.getCurrentModeState().tasks; diff --git a/frontend/javascripts/dashboard/dataset_folder_view.tsx b/frontend/javascripts/dashboard/dataset_folder_view.tsx index 87c25c4f6b9..1c0a8f3c852 100644 --- a/frontend/javascripts/dashboard/dataset_folder_view.tsx +++ b/frontend/javascripts/dashboard/dataset_folder_view.tsx @@ -179,7 +179,8 @@ function DatasetFolderViewInner(props: Props) { hierarchy != null && hierarchy.flatItems.length === 1 && context.datasets.length === 0 && - context.activeFolderId != null + context.activeFolderId != null && + !context.isLoading ) { // Show a placeholder if only the root folder exists and no dataset is available yet // (aka a new, empty organization) diff --git a/frontend/javascripts/dashboard/explorative_annotations_view.tsx b/frontend/javascripts/dashboard/explorative_annotations_view.tsx index c378abc895d..41b6118306b 100644 --- a/frontend/javascripts/dashboard/explorative_annotations_view.tsx +++ b/frontend/javascripts/dashboard/explorative_annotations_view.tsx @@ -440,7 +440,7 @@ class ExplorativeAnnotationsView extends React.PureComponent { }; getEmptyListPlaceholder = () => { - return ( + return this.state.isLoading ? null : ( }>