1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

[bugfix] fix non-blocking js error when there is not payment gateway set

This commit is contained in:
Nicolas Florentin 2022-02-07 13:48:01 +01:00
parent 5f5af95634
commit 7b12e56521

View File

@ -90,7 +90,9 @@ export const AbstractPaymentModal: React.FC<AbstractPaymentModalProps> = ({ isOp
CustomAssetAPI.get(CustomAssetName.CgvFile).then(asset => setCgv(asset)); CustomAssetAPI.get(CustomAssetName.CgvFile).then(asset => setCgv(asset));
SettingAPI.get(SettingName.PaymentGateway).then((setting) => { SettingAPI.get(SettingName.PaymentGateway).then((setting) => {
// we capitalize the first letter of the name // we capitalize the first letter of the name
setGateway(setting.value.replace(/^\w/, (c) => c.toUpperCase())); if (setting.value) {
setGateway(setting.value.replace(/^\w/, (c) => c.toUpperCase()));
}
}); });
return () => { mounted.current = false; }; return () => { mounted.current = false; };