Skip to content

Commit 77d571c

Browse files
committed
chore: update code based on feedback
1 parent 830e1e8 commit 77d571c

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

packages/pluggableWidgets/file-uploader-web/src/FileUploader.editorConfig.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ export function check(values: FileUploaderPreviewProps): Problem[] {
8989
}
9090
}
9191

92-
// Note: maxFilesPerUpload validation is handled at runtime since it's an expression
93-
9492
if (values.enableCustomButtons) {
9593
// check that at max one actions is default
9694
const defaultIdx = new Set<number>();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ export class FileUploaderStore {
121121

122122
get maxFilesPerUpload(): number {
123123
const expressionValue = this._maxFilesPerUpload.value;
124-
if (expressionValue && !isNaN(Number(expressionValue))) {
125-
return Number(expressionValue);
124+
if (expressionValue) {
125+
return expressionValue.toNumber();
126126
}
127127
// Fallback to unlimited
128128
return 0;
@@ -153,7 +153,7 @@ export class FileUploaderStore {
153153

154154
if (fileRejections.length && fileRejections[0].errors[0].code === "too-many-files") {
155155
this.setMessage(
156-
this.translations.get("uploadFailureTooManyFilesMessage", this.maxFilesPerUpload?.toString() ?? "")
156+
this.translations.get("uploadFailureTooManyFilesMessage", this.maxFilesPerUpload.toString())
157157
);
158158
return;
159159
}

0 commit comments

Comments
 (0)