Skip to content

Commit

Permalink
Always remove OAuth window event listener (#9415)
Browse files Browse the repository at this point in the history
`cloudsync.onedrive_list_drives` was called for pCloud credential. I suppose, the component was previously
used to perform a OneDrive authorization and OneDrive event listener did not remove itself due to an
unhandled exception.
  • Loading branch information
themylogin authored Jan 8, 2024
1 parent 31ca5d4 commit c365ed2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,7 @@ export class CloudCredentialsFormComponent {
window.addEventListener('message', doAuth, false);

function doAuth(message) {
window.removeEventListener('message', doAuth);
if (message.data.oauth_portal) {
if (message.data.error) {
dialogService.errorReport(T('Error'), message.data.error);
Expand All @@ -1263,7 +1264,6 @@ export class CloudCredentialsFormComponent {
getOnedriveList(message.data);
}
}
window.removeEventListener('message', doAuth);
}
},
},
Expand Down

0 comments on commit c365ed2

Please sign in to comment.