mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-26 16:07:13 +00:00
Improve email confirmation window layout and options
This commit is contained in:
@@ -23,6 +23,7 @@ import UIAlert from './UIAlert.js';
|
||||
function UIWindowEmailConfirmationRequired (options) {
|
||||
return new Promise(async (resolve) => {
|
||||
options = options ?? {};
|
||||
options.window_options = options.window_options ?? {};
|
||||
let final_code = '';
|
||||
let is_checking_code = false;
|
||||
|
||||
@@ -30,7 +31,7 @@ function UIWindowEmailConfirmationRequired (options) {
|
||||
|
||||
let h = '';
|
||||
h += '<div class="qr-code-window-close-btn generic-close-window-button"> × </div>';
|
||||
h += '<div style="-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #3e5362;">';
|
||||
h += '<div style="-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #3e5362; max-width: 350px; margin: 0 auto;">';
|
||||
h += `<img src="${html_encode(window.icons['mail.svg'])}" style="display:block; margin:10px auto 10px;">`;
|
||||
h += `<h3 style="text-align:center; font-weight: 500; font-size: 20px;">${i18n('confirm_your_email_address')}</h3>`;
|
||||
h += '<form>';
|
||||
@@ -75,6 +76,7 @@ function UIWindowEmailConfirmationRequired (options) {
|
||||
backdrop: true,
|
||||
width: 390,
|
||||
dominant: true,
|
||||
...options.window_options,
|
||||
onAppend: function (el_window) {
|
||||
$(el_window).find('.digit-input').first().focus();
|
||||
},
|
||||
|
||||
@@ -610,6 +610,10 @@ window.initgui = async function (options) {
|
||||
is_verified = await UIWindowEmailConfirmationRequired({
|
||||
stay_on_top: true,
|
||||
has_head: false,
|
||||
logout_in_footer: true,
|
||||
window_options: {
|
||||
cover_page: window.is_embedded,
|
||||
},
|
||||
});
|
||||
}
|
||||
while ( !is_verified );
|
||||
@@ -941,10 +945,12 @@ window.initgui = async function (options) {
|
||||
}
|
||||
// Show email confirmation screen
|
||||
else if ( data.email && data.email === window.user.email && !window.user.email_confirmed ) {
|
||||
// todo show email confirmation window
|
||||
await UIWindowEmailConfirmationRequired({
|
||||
stay_on_top: true,
|
||||
has_head: false,
|
||||
window_options: {
|
||||
cover_page: window.is_embedded,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user