Skip to content

Commit

Permalink
adding failsafe for setting
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Apr 24, 2020
1 parent b0ba509 commit 712bc25
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import numeral from '@elastic/numeral';
import { ml } from '../../../../services/ml_api_service';
import { AnalysisResult, InputOverrides } from '../../../../../../common/types/file_datavisualizer';
import {
MAX_FILE_SIZE,
MAX_FILE_SIZE_BYTES,
ABSOLUTE_MAX_FILE_SIZE_BYTES,
FILE_SIZE_DISPLAY_FORMAT,
Expand Down Expand Up @@ -63,7 +64,7 @@ export function readFile(file: File) {
}

export function getMaxBytes() {
const maxFileSize = getUiSettings().get(FILE_DATA_VISUALIZER_MAX_FILE_SIZE);
const maxFileSize = getUiSettings().get(FILE_DATA_VISUALIZER_MAX_FILE_SIZE, MAX_FILE_SIZE);
// @ts-ignore
const maxBytes = numeral(maxFileSize.toUpperCase()).value();
if (maxBytes < MAX_FILE_SIZE_BYTES) {
Expand Down

0 comments on commit 712bc25

Please sign in to comment.