Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions src/client/app/components/admin/PreferencesComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,20 @@ export default function PreferencesComponent() {
invalid={invalidFuncs.warningFileSize()}
/>
<FormFeedback>
<FormattedMessage id="error.bounds" values={{ min: 0, max: Number(localAdminPref.defaultFileSizeLimit) }} />
{Number(localAdminPref.defaultWarningFileSize) < 0 ? (
<FormattedMessage
id="error.greater"
values={{ min: 0 }}
/>
) : (
<FormattedMessage
id="error.bounds"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are formatting issues with this file: 1) wrong indenting; 2) space indenting instead of tabs. VSC can fix this with commands.

values={{
min: 0,
max: Number(localAdminPref.defaultFileSizeLimit)
}}
/>
)}
</FormFeedback>
</div>
<div>
Expand All @@ -345,7 +358,17 @@ export default function PreferencesComponent() {
invalid={invalidFuncs.fileSizeLimit()}
/>
<FormFeedback>
<FormattedMessage id="error.bounds" values={{ min: Number(localAdminPref.defaultWarningFileSize), max: Infinity }} />
{Number(localAdminPref.defaultFileSizeLimit) < 0 ? (
<FormattedMessage
id="error.greater"
values={{ min: 0 }}
/>
) : (
<FormattedMessage
id="error.greater"
values={{ min: Number(localAdminPref.defaultWarningFileSize) }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to check for max of infinity. Now one can enter a really big value and submit it. Then it fails to save. I prefer the other way.

/>
)}
</FormFeedback>
</div>
<div>
Expand Down