Skip to content

Commit c26e865

Browse files
committed
fix: download issues
1 parent f069aba commit c26e865

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

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 an issue with Download button not working on Mendix 11.8.
12+
913
## [2.4.1] - 2026-02-12
1014

1115
### Fixed

packages/pluggableWidgets/file-uploader-web/src/components/ActionsBar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ function DefaultActionsBar(props: ButtonsBarProps): ReactElement {
4848
props.store.remove();
4949
}, [props.store]);
5050

51-
const onViewClick = useCallback(() => {
52-
onDownloadClick(props.store.downloadUrl);
53-
}, [props.store.downloadUrl]);
51+
const onViewClick = useCallback(async () => {
52+
onDownloadClick(await props.store.getDownloadUrl());
53+
}, [props.store]);
5454

5555
return (
5656
<div className={"entry-details-actions"}>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export class FileStore {
205205
}
206206
}
207207

208-
get downloadUrl(): string | undefined {
208+
async getDownloadUrl(): Promise<string | undefined> {
209209
if (this._mxObject) {
210210
return fetchDocumentUrl(this._mxObject);
211211
}

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

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

42-
export function fetchDocumentUrl(mxObject: MxObject): string {
42+
export async function fetchDocumentUrl(mxObject: MxObject): Promise<string> {
4343
return (window as any).mx.data.getDocumentUrl(mxObject.getGuid(), mxObject.get("changedDate"), false);
4444
}
4545

46-
export function fetchImageThumbnail(mxObject: MxObject): Promise<string> {
47-
const docUrl = (window as any).mx.data.getDocumentUrl(mxObject.getGuid(), mxObject.get("changedDate"), true);
46+
export async function fetchImageThumbnail(mxObject: MxObject): Promise<string> {
47+
const docUrl = await (window as any).mx.data.getDocumentUrl(mxObject.getGuid(), mxObject.get("changedDate"), true);
4848
return new Promise<string>((resolve, reject) => {
4949
(window as any).mx.data.getImageUrl(docUrl, resolve, reject);
5050
});

0 commit comments

Comments
 (0)