Fix comparing MB -> bytes

This commit is contained in:
Jaiwanth 2021-08-03 14:53:23 +05:30
parent 4824c93707
commit b333612dea
2 changed files with 31 additions and 22 deletions

View file

@ -42,7 +42,9 @@ export default abstract class Exporter {
protected exportOptions: IExportOptions,
protected exportProgressRef: MutableRefObject<HTMLParagraphElement>,
) {
if (exportOptions.maxSize < 1 || exportOptions.maxSize > 2000 || exportOptions.numberOfMessages > 10**8) {
if (exportOptions.maxSize < 1 * 1024 * 1024||
exportOptions.maxSize > 2000 * 1024 * 1024||
exportOptions.numberOfMessages > 10**8) {
throw new Error("Invalid export options");
}
this.cancelled = false;