Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const values = childrenArray.reduce((obj, child) => (child.props && child.props.forKey ? {
...obj,
[child.props.forKey]: separator,
} : obj), { ...params });
// Split the tokenized string at the separators.
const stringParts = i18n.text(string, values).split(separator);
// Create a new array containing the separated chunks of the text and merge the substitutions.
formatted = stringParts.reduce((result, text, index) => [
...result,
text,
childrenArray[index],
], []);
} catch (e) {
logger.error('i18n error for string %s', string, e);
}
return (
<span role="{role}">{formatted}</span>
);
};
.catch((error) => {
logger.error(error);
dispatch(actions.errorPageConfig(pageId));
});
};
.catch((error) => {
logger.error(error);
dispatch(errorClientInformation());
});
};
.catch((error) => {
logger.error(error);
dispatch(actions.errorUrl(URL_TYPE_REGISTER));
reject();
});
});
componentDidUpdate() {
if (!(this.ref instanceof HTMLElement)) {
logger.error('Ref is not an HTMLElement');
return;
}
this.ref.style.height = `${this.baseHeight}px`;
this.ref.style.height = `${this.ref.scrollHeight}px`;
}
.catch((error) => {
logger.error(error);
dispatch(actions.errorPageConfig(pageId, error.code));
});
};
.catch((error) => {
logger.error(error);
dispatch(actions.errorLogout());
});
};
if (code === EINVALIDCALL) {
/**
* This code is thrown when the login request failed, because the user was already logged
* in. In that situation the success action can also dispatch to trigger the necessary
* processes which has to happen after a successful login.
*/
dispatch(actions.successLogin(redirect, strategy));
} else if (code === ELEGACYSGCONNECT) {
/**
* The app is connected to the shop system via the legacy shopgate connect. Login via
* the shop system credentials failed and further steps are necessary to login the user.
*/
dispatch(actions.errorLegacyConnectRegister());
dispatch(actions.errorLogin([], ELEGACYSGCONNECT));
} else {
logger.error(error);
dispatch(actions.errorLogin([], code));
}
});
};
.catch((error) => {
logger.error(error);
dispatch(actions.errorMenu(id));
});
};
.catch((error) => {
if (error.code !== EACCESS) {
logger.error(error);
}
dispatch(actions.toggleLoggedIn(false));
dispatch(actions.errorUser(error));
});
};