mirror of
https://github.com/vector-im/element-call.git
synced 2026-02-20 04:57:03 +00:00
Enable lint rules for Promise handling to discourage misuse of them. (#2607)
* Enable lint rules for Promise handling to discourage misuse of them. Squashed all of Hugh's commits into one. --------- Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
This commit is contained in:
@@ -63,7 +63,7 @@ export function useRecaptcha(sitekey?: string): {
|
||||
}
|
||||
}, [recaptchaId, sitekey]);
|
||||
|
||||
const execute = useCallback((): Promise<string> => {
|
||||
const execute = useCallback(async (): Promise<string> => {
|
||||
if (!sitekey) {
|
||||
return Promise.resolve("");
|
||||
}
|
||||
@@ -95,7 +95,12 @@ export function useRecaptcha(sitekey?: string): {
|
||||
},
|
||||
};
|
||||
|
||||
window.grecaptcha.execute();
|
||||
window.grecaptcha.execute().then(
|
||||
() => {}, // noop
|
||||
(e) => {
|
||||
logger.error("Recaptcha execution failed", e);
|
||||
},
|
||||
);
|
||||
|
||||
const iframe = document.querySelector<HTMLIFrameElement>(
|
||||
'iframe[src*="recaptcha/api2/bframe"]',
|
||||
|
||||
Reference in New Issue
Block a user