ensure cancel error is triggered if exit and oauth not processed

This commit is contained in:
Nacho Codoñer
2024-12-19 15:28:40 +01:00
parent d6688c6f1c
commit bd68461e5d

View File

@@ -64,6 +64,12 @@ OAuth.showPopup = (url, callback, dimensions) => {
};
const onExit = () => {
// Force callback to throw cancel error when exit
// and oauth process didn't start
if (!oauthFinished) {
callback();
}
popup.removeEventListener('loadstop', pageLoaded);
popup.removeEventListener('loaderror', fail);
popup.removeEventListener('exit', onExit);