Skip to content

Commit 67db169

Browse files
authored
Fix file thumbnail info. (#353)
1 parent dc4f787 commit 67db169

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/FileFormatter/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const FileFormatter = ({
9191
return (
9292
<div className={className}>
9393
{value.map((item, index) => {
94-
const dom = (<FileItemFormatter openFile={openFile} file={item} />);
94+
const dom = (<FileItemFormatter openFile={openFile} file={item} config={{ server, dtableUuid, workspaceID }} />);
9595
if (renderItem) return (<Fragment key={index}>{renderItem(dom)}</Fragment>);
9696
return (<Fragment key={index}>{dom}</Fragment>);
9797
})}

src/utils/url.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ export const getFileIconUrl = (filename, direntType) => {
158158
return defaultIconUrl['192'];
159159
};
160160

161-
export const getFileThumbnailInfo = (file, { server } = {}) => {
161+
export const getFileThumbnailInfo = (file, { server, dtableUuid, workspaceID } = {}) => {
162162
const defaultIcon = FILEEXT_ICON_MAP['default'];
163163
const defaultIconUrl = FILEEXT_ICON_URL_MAP[defaultIcon];
164164
if (!file || !file.name) return { isImage: false, fileIconUrl: defaultIconUrl['192'] };
165165
const isImage = imageCheck(file.name);
166-
if (isImage && server) return { isImage, fileIconUrl: getImageThumbnailUrl(file.url, { server }) };
166+
if (isImage && server) return { isImage, fileIconUrl: getImageThumbnailUrl(file.url, { server, dtableUuid, workspaceID }) };
167167
const iconUrl = getFileIconUrl(file.name, file.type);
168168
return { fileIconUrl: iconUrl, isImage: false };
169169
};

0 commit comments

Comments
 (0)