Remove the confirmation prompt when closing the 2FA setup winow

When exiting a window there should be a confirmation if exiting that window will irreversibly destroy work. For example, when you're working on a document and if you exit unsaved changes will be lost.
This doesn't seem to be the case. What work will be irreversibly lost?
This commit is contained in:
Nariman Jelveh 2024-05-03 18:05:41 -07:00 committed by KernelDeimos
parent 144d647540
commit 12c883b6fd
2 changed files with 7 additions and 25 deletions

View File

@ -16,6 +16,9 @@ export default class StringView extends Component {
margin: 0;
color: hsl(220, 25%, 31%);
}
span {
color: #3b4863;
}
`;
create_template ({ template }) {

View File

@ -176,31 +176,9 @@ const UIWindow2FASetup = async function UIWindow2FASetup () {
win = await UIComponentWindow({
component,
on_before_exit: async () => {
// If stepper was exhausted, we can close the window
if ( stepper.get('done') ) return true;
// Otherwise the user is trying to cancel the setup
const will_close = await UIAlert({
message: i18n('cancel_2fa_setup'),
buttons: [
{
label: i18n('yes'),
value: true,
type: 'primary',
},
{
label: i18n('no'),
value: false,
},
]
});
if ( will_close ) {
promise.resolve(false);
return true;
}
},
// on_before_exit: async () => {
// return true;
// },
title: '2FA Setup',
app: 'instant-login',
@ -223,6 +201,7 @@ const UIWindow2FASetup = async function UIWindow2FASetup () {
dominant: true,
show_in_taskbar: false,
draggable_body: true,
center: true,
onAppend: function(this_window){
},
window_class: 'window-qr',