Skip to content

Commit

Permalink
feat: update code
Browse files Browse the repository at this point in the history
  • Loading branch information
杨国璇 authored and 杨国璇 committed Aug 7, 2024
1 parent 8a18758 commit 92c33fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class DirentDetails extends React.Component {
const { dirent, direntDetail, collaborators, collaboratorsCache } = this.state;
const { repoID, path, fileTags } = this.props;
const direntName = dirent?.name || '';
const smallIconUrl = dirent ? Utils.getDirentIcon(dirent) : '';
const smallIconUrl = Utils.getDirentIcon(dirent);

return (
<Detail>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ export const Utils = {
},

getDirentIcon: function (dirent, isBig) {
if (!dirent) return mediaUrl + 'img/file/256/' + this.FILEEXT_ICON_MAP['default'];
let size = this.isHiDPI() ? 48 : 24;
size = isBig ? 192 : size;
if (dirent.isDir()) {
Expand Down

0 comments on commit 92c33fb

Please sign in to comment.