[FIX] auth_totp: fix the incomplete fix
The previous pass in #97567 missed a small window of race condition in *closing the fecking dialog*. Apparently that's still not instantaneous enough and it's possible to have the check trigger in the interval between clicking the button and the dialog being completely torn down. Add an explicit test for this to the existing `closeProfileDialog` utility function. closes odoo/odoo#97969 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
@@ -59,6 +59,17 @@ function closeProfileDialog({content, totp_state}) {
|
||||
$modal.find('button[name=preference_cancel]').click()
|
||||
}
|
||||
}
|
||||
}, {
|
||||
trigger: 'body',
|
||||
async run() {
|
||||
while (document.querySelector('.o_dialog_container .o_dialog')) {
|
||||
await Promise.resolve();
|
||||
}
|
||||
this.$anchor.addClass('dialog-closed');
|
||||
},
|
||||
}, {
|
||||
trigger: 'body.dialog-closed',
|
||||
run() {},
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user