mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-07-12 01:23:34 +02:00
Show empty file (#1762)
Show empty file instead of an endless loading spinner.
This commit is contained in:
2
gradle/changelog/show_empty_file.yaml
Normal file
2
gradle/changelog/show_empty_file.yaml
Normal 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))
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user