Skip to content

Commit

Permalink
Update type scenarios where AppLogic values were previously thought p…
Browse files Browse the repository at this point in the history
…otentially undefined

- which is mostly just configuredLimits it looks like
  • Loading branch information
cee-chen committed Mar 2, 2021
1 parent b6bbc8b commit f38d6ad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ export const FlyoutHeader: React.FC = () => {
};

export const FlyoutBody: React.FC = () => {
const { configuredLimits } = useValues(AppLogic);
const maxDocumentByteSize = configuredLimits?.engine?.maxDocumentByteSize;
const {
configuredLimits: {
engine: { maxDocumentByteSize },
},
} = useValues(AppLogic);

const { textInput, errors } = useValues(DocumentCreationLogic);
const { setTextInput } = useActions(DocumentCreationLogic);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ export const FlyoutHeader: React.FC = () => {
};

export const FlyoutBody: React.FC = () => {
const { configuredLimits } = useValues(AppLogic);
const maxDocumentByteSize = configuredLimits?.engine?.maxDocumentByteSize;
const {
configuredLimits: {
engine: { maxDocumentByteSize },
},
} = useValues(AppLogic);

const { isUploading, errors } = useValues(DocumentCreationLogic);
const { setFileInput } = useActions(DocumentCreationLogic);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const comboBoxOptionToEngineName = (option: EuiComboBoxOptionOption<string>): st
export const MetaEngineCreation: React.FC = () => {
const {
configuredLimits: {
engine: { maxEnginesPerMetaEngine } = { maxEnginesPerMetaEngine: Infinity },
engine: { maxEnginesPerMetaEngine },
},
} = useValues(AppLogic);

Expand Down

0 comments on commit f38d6ad

Please sign in to comment.