Compare commits
2 Commits
131ed8d608
...
401ebb40d5
| Author | SHA1 | Date |
|---|---|---|
|
|
401ebb40d5 | |
|
|
36a530b8d7 |
|
|
@ -432,8 +432,9 @@ export default function App() {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
alert(err.response?.data?.detail || 'Failed to save billing phone number.');
|
const errorMsg = err.response?.data?.detail || 'Failed to save billing phone number.';
|
||||||
return false;
|
alert(errorMsg);
|
||||||
|
throw new Error(errorMsg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,15 @@ export const BillingPhoneModal: React.FC<BillingPhoneModalProps> = ({
|
||||||
|
|
||||||
setSaving(true);
|
setSaving(true);
|
||||||
const e164 = formatE164Phone(dialCode, phone);
|
const e164 = formatE164Phone(dialCode, phone);
|
||||||
const success = await onSavePhone(e164, country);
|
try {
|
||||||
setSaving(false);
|
const success = await onSavePhone(e164, country);
|
||||||
if (success) {
|
if (success) {
|
||||||
onClose();
|
onClose();
|
||||||
|
}
|
||||||
|
} catch (err: any) {
|
||||||
|
setError(err?.message || 'Failed to save billing phone number.');
|
||||||
|
} finally {
|
||||||
|
setSaving(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue