chore: Clarify usage of window fields in UIWindowSessionList.js

/puter/src/UI/UIWindowSessionList.js
   33:117  error  'icons' is not defined             no-undef
   34:41   error  'logged_in_users' is not defined   no-undef
   35:32   error  'logged_in_users' is not defined   no-undef
  134:36   error  'logged_in_users' is not defined   no-undef
  141:17   error  'update_auth_data' is not defined  no-undef
This commit is contained in:
Sam Atkins
2024-05-01 17:18:08 +01:00
parent 66cdf98190
commit 72c0e118c3

View File

@@ -30,9 +30,9 @@ async function UIWindowSessionList(options){
h += `<div style="margin:10px;">`;
h += `<div class="loading">${i18n('signing_in')}</div>`
h += `<div style="overflow-y: scroll; max-width: 400px; margin: 0 auto;">`;
h += `<h1 style="text-align: center; font-size: 18px; font-weight: normal; color: #757575;"><img src="${icons['logo-white.svg']}" style="padding: 4px; background-color: blue; border-radius: 5px; width: 25px; box-sizing: border-box; margin-bottom: -6px; margin-right: 6px;">${i18n('sign_in_with_puter')}</h1>`
for (let index = 0; index < logged_in_users.length; index++) {
const l_user = logged_in_users[index];
h += `<h1 style="text-align: center; font-size: 18px; font-weight: normal; color: #757575;"><img src="${window.icons['logo-white.svg']}" style="padding: 4px; background-color: blue; border-radius: 5px; width: 25px; box-sizing: border-box; margin-bottom: -6px; margin-right: 6px;">${i18n('sign_in_with_puter')}</h1>`
for (let index = 0; index < window.logged_in_users.length; index++) {
const l_user = window.logged_in_users[index];
h += `<div data-uuid="${l_user.uuid}" class="session-entry">${l_user.username}</div>`;
}
h += `</div>`;
@@ -131,14 +131,14 @@ async function UIWindowSessionList(options){
let selected_uuid = $(this).attr('data-uuid');
let selected_user;
for (let index = 0; index < window.logged_in_users.length; index++) {
const l_user = logged_in_users[index];
const l_user = window.logged_in_users[index];
if(l_user.uuid === selected_uuid){
selected_user = l_user;
}
}
// new logged in user
update_auth_data(selected_user.auth_token, selected_user);
window.update_auth_data(selected_user.auth_token, selected_user);
if(options.reload_on_success){
// disable native browser exit confirmation
window.onbeforeunload = null;