Refactor: add missing await expression (#1059)

This commit is contained in:
arunkc 2021-10-15 07:41:32 +05:30 committed by GitHub
parent 6c137306d8
commit af5804776e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -6,13 +6,13 @@ import { resolveReferences, resolveWidgetFieldValue } from '@/_helpers/utils';
export const QrScanner = function QrScanner({ component, onEvent, onComponentOptionChanged, currentState }) {
const handleError = async (errorMessage) => {
console.log(errorMessage);
setErrorOccured(true);
await setErrorOccured(true);
};
const handleScan = async (data) => {
if (data !== null) {
onEvent('onDetect', { component, data: data });
onComponentOptionChanged(component, 'lastDetectedValue', data);
await onEvent('onDetect', { component, data: data });
await onComponentOptionChanged(component, 'lastDetectedValue', data);
}
};

View file

@ -22,7 +22,7 @@ function SettingsPage(props) {
const changePassword = async () => {
setPasswordChangeInProgress(true);
const response = userService.changePassword(currentpassword, newPassword);
const response = await userService.changePassword(currentpassword, newPassword);
response
.then(() => {
toast.success('Password updated successfully', { hideProgressBar: true, autoClose: 3000 });
@ -40,7 +40,7 @@ function SettingsPage(props) {
const newPasswordKeyPressHandler = async (event) => {
if (event.key === 'Enter') {
changePassword();
await changePassword();
}
};