Skip to content

Commit

Permalink
Only follow default validation flow of valid size of export, when Exp…
Browse files Browse the repository at this point in the history
…ortDefaultSizeLimit - is default value (true)
  • Loading branch information
John Tore Simonsen committed Oct 4, 2024
1 parent 317d230 commit 80eeffc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/views/dialogs/ExportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const useExportFormState = (): ExportConfig => {
: config.includeAttachments ?? false,
);
const [numberOfMessages, setNumberOfMessages] = useState<number>(config.numberOfMessages ?? 100);
const [sizeLimit, setSizeLimit] = useState(
const [sizeLimit, setSizeLimit] = useState<number>(
SettingsStore.getValue(UIFeature.ExportDefaultSizeLimit) == false ? 20 : config.sizeMb ?? 8,
);

Expand Down Expand Up @@ -158,11 +158,10 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {

const onExportClick = async (): Promise<void> => {
const isValidSize =
!setSizeLimit ||
(!setSizeLimit ||
(await sizeLimitRef.current?.validate({
focused: false,
}));

}))) || !SettingsStore.getValue(UIFeature.ExportDefaultSizeLimit);
if (!isValidSize) {
sizeLimitRef.current?.validate({ focused: true });
return;
Expand Down

0 comments on commit 80eeffc

Please sign in to comment.