Skip to content

Commit c382114

Browse files
committed
fix: file uploader image thumbnail issue
1 parent 31c39ec commit c382114

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

packages/pluggableWidgets/file-uploader-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We fixed image thumbnail issue that was failed to reload on refresh page.
12+
913
## [2.2.1] - 2025-05-28
1014

1115
### Fixed

packages/pluggableWidgets/file-uploader-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/file-uploader-web",
33
"widgetName": "FileUploader",
4-
"version": "2.2.1",
4+
"version": "2.2.2",
55
"description": "",
66
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
77
"license": "Apache-2.0",

packages/pluggableWidgets/file-uploader-web/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="FileUploader" version="2.2.1" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="FileUploader" version="2.2.2" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="FileUploader.xml" />
66
</widgetFiles>

packages/pluggableWidgets/file-uploader-web/src/stores/FileStore.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
fetchDocumentUrl,
99
fetchImageThumbnail,
1010
fetchMxObject,
11-
isImageObject,
1211
MxObject,
1312
removeObject,
1413
saveFile
@@ -179,7 +178,7 @@ export class FileStore {
179178
}
180179

181180
this._thumbnailUrl = undefined;
182-
if (this._mxObject && isImageObject(this._mxObject)) {
181+
if (this._mxObject) {
183182
const url = await fetchImageThumbnail(this._mxObject);
184183
runInAction(() => {
185184
this._thumbnailUrl = url;

packages/pluggableWidgets/file-uploader-web/src/utils/mx-data.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ export function fetchMxObject(objectItem: ObjectItem): Promise<MxObject> {
3939
});
4040
}
4141

42-
export function isImageObject(mxObject: MxObject): boolean {
43-
return (window as any).mx.meta.getEntity(mxObject.getEntity()).isA("System.Image");
44-
}
45-
4642
export function fetchDocumentUrl(mxObject: MxObject): string {
4743
return (window as any).mx.data.getDocumentUrl(mxObject.getGuid(), mxObject.get("changedDate"), false);
4844
}

0 commit comments

Comments
 (0)