Skip to content

Commit

Permalink
corret typos
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Nov 15, 2021
1 parent ad2016b commit c16d8f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function useFleetServerHostsForm(
fleetServerHostsDefaultValue: string[],
onSuccess: () => void
) {
const [isLoading, setIsloading] = React.useState(false);
const [isLoading, setIsLoading] = React.useState(false);
const { notifications } = useStartServices();
const { confirm } = useConfirmModal();

Expand Down Expand Up @@ -110,7 +110,7 @@ export function useFleetServerHostsForm(
) {
return;
}
setIsloading(true);
setIsLoading(true);
const settingsResponse = await sendPutSettings({
fleet_server_hosts: fleetServerHostsInput.value,
});
Expand All @@ -122,10 +122,10 @@ export function useFleetServerHostsForm(
defaultMessage: 'Settings saved',
})
);
setIsloading(false);
setIsLoading(false);
onSuccess();
} catch (error) {
setIsloading(false);
setIsLoading(false);
notifications.toasts.addError(error, {
title: i18n.translate('xpack.fleet.settings.fleetServerHostsFlyout.errorToastTitle', {
defaultMessage: 'An error happened while saving settings',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ export function useConfirmModal() {
}

export const ConfirmModalProvider: React.FunctionComponent = ({ children }) => {
const [isVisible, setIsVisble] = useState(false);
const [isVisible, setIsVisible] = useState(false);
const [modal, setModal] = useState<ModalState>({
onCancel: () => {},
onConfirm: () => {},
});

const showModal = useCallback(({ title, description, onConfirm, onCancel }) => {
setIsVisble(true);
setIsVisible(true);
setModal({
title,
description,
onConfirm: () => {
setIsVisble(false);
setIsVisible(false);
onConfirm();
},
onCancel: () => {
setIsVisble(false);
setIsVisible(false);
onCancel();
},
});
Expand Down

0 comments on commit c16d8f7

Please sign in to comment.