Show empty file (#1762)

Show empty file instead of an endless loading spinner.
This commit is contained in:
Eduard Heimbuch
2021-08-06 08:31:36 +02:00
committed by GitHub
parent 8ce69d9848
commit 842b0b7698
2 changed files with 4 additions and 2 deletions

View File

@@ -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))

View File

@@ -41,13 +41,13 @@ const SourcecodeViewer: FC<Props> = ({ file, language }) => {
return <ErrorNotification error={error} />;
}
if (!content || isLoading) {
if (isLoading) {
return <Loading />;
}
const permalink = replaceBranchWithRevision(location.pathname, file.revision);
return <SyntaxHighlighter language={language.toLowerCase()} value={content} permalink={permalink} />;
return <SyntaxHighlighter language={language.toLowerCase()} value={content || ""} permalink={permalink} />;
};
export default SourcecodeViewer;