Fix settings card update

This commit is contained in:
KernelDeimos 2024-05-05 23:35:17 -04:00
parent 00c8ece07e
commit 63e72a22e0
2 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,7 @@ export default {
// configure 2FA // configure 2FA
if(!user.is_temp){ if(!user.is_temp){
h += `<div class="settings-card ${user.otp ? 'settings-card-success' : 'settings-card-warning'}">`; h += `<div class="settings-card settings-card-security ${user.otp ? 'settings-card-success' : 'settings-card-warning'}">`;
h += `<div>`; h += `<div>`;
h += `<strong style="display:block;">${i18n('two_factor')}</strong>`; h += `<strong style="display:block;">${i18n('two_factor')}</strong>`;
h += `<span class="user-otp-state" style="display:block; margin-top:5px;">${ h += `<span class="user-otp-state" style="display:block; margin-top:5px;">${
@ -54,6 +54,8 @@ export default {
$el_window.find('.enable-2fa').hide(); $el_window.find('.enable-2fa').hide();
$el_window.find('.disable-2fa').show(); $el_window.find('.disable-2fa').show();
$el_window.find('.user-otp-state').text(i18n('two_factor_enabled')); $el_window.find('.user-otp-state').text(i18n('two_factor_enabled'));
$el_window.find('.settings-card-security').removeClass('settings-card-warning');
$el_window.find('.settings-card-security').addClass('settings-card-success');
} }
return; return;
@ -109,6 +111,8 @@ export default {
$el_window.find('.enable-2fa').show(); $el_window.find('.enable-2fa').show();
$el_window.find('.disable-2fa').hide(); $el_window.find('.disable-2fa').hide();
$el_window.find('.user-otp-state').text(i18n('two_factor_disabled')); $el_window.find('.user-otp-state').text(i18n('two_factor_disabled'));
$el_window.find('.settings-card-security').removeClass('settings-card-success');
$el_window.find('.settings-card-security').addClass('settings-card-warning');
}); });
} }
} }

View File

@ -117,7 +117,7 @@ const UIWindow2FASetup = async function UIWindow2FASetup () {
async [`property.value`] (value, { component }) { async [`property.value`] (value, { component }) {
console.log('value? ', value) console.log('value? ', value)
if ( false && ! await check_code_(value) ) { if ( ! await check_code_(value) ) {
component.set('error', 'Invalid code'); component.set('error', 'Invalid code');
return; return;
} }