From 842b0b7698ca7ddc654ad27f8aa606413e08be48 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Fri, 6 Aug 2021 08:31:36 +0200 Subject: [PATCH] Show empty file (#1762) Show empty file instead of an endless loading spinner. --- gradle/changelog/show_empty_file.yaml | 2 ++ .../src/repos/sources/components/content/SourcecodeViewer.tsx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 gradle/changelog/show_empty_file.yaml diff --git a/gradle/changelog/show_empty_file.yaml b/gradle/changelog/show_empty_file.yaml new file mode 100644 index 0000000000..1a20aa9226 --- /dev/null +++ b/gradle/changelog/show_empty_file.yaml @@ -0,0 +1,2 @@ +- type: Fixed + description: Show empty files instead of endless loading spinner ([#1762](https://github.com/scm-manager/scm-manager/pull/1762)) diff --git a/scm-ui/ui-webapp/src/repos/sources/components/content/SourcecodeViewer.tsx b/scm-ui/ui-webapp/src/repos/sources/components/content/SourcecodeViewer.tsx index 1f86a781ae..5e72c3dab7 100644 --- a/scm-ui/ui-webapp/src/repos/sources/components/content/SourcecodeViewer.tsx +++ b/scm-ui/ui-webapp/src/repos/sources/components/content/SourcecodeViewer.tsx @@ -41,13 +41,13 @@ const SourcecodeViewer: FC = ({ file, language }) => { return ; } - if (!content || isLoading) { + if (isLoading) { return ; } const permalink = replaceBranchWithRevision(location.pathname, file.revision); - return ; + return ; }; export default SourcecodeViewer;