chore: Clarify usage of window fields in UIWindowDesktopBGSettings.js

/puter/src/UI/UIWindowDesktopBGSettings.js
  168:26  error  'api_origin' is not defined  no-undef
  178:52  error  'auth_token' is not defined  no-undef
  182:29  error  'logout' is not defined      no-undef
  188:24  error  Empty block statement        no-empty
This commit is contained in:
Sam Atkins 2024-05-01 16:36:00 +01:00
parent dea3bc1a7f
commit 93e13cdb06

View File

@ -165,7 +165,7 @@ async function UIWindowDesktopBGSettings(options){
// /set-desktop-bg
try{
$.ajax({
url: api_origin + "/set-desktop-bg",
url: window.api_origin + "/set-desktop-bg",
type: 'POST',
data: JSON.stringify({
url: window.desktop_bg_url,
@ -175,17 +175,18 @@ async function UIWindowDesktopBGSettings(options){
async: true,
contentType: "application/json",
headers: {
"Authorization": "Bearer "+auth_token
"Authorization": "Bearer "+window.auth_token
},
statusCode: {
401: function () {
logout();
window.logout();
},
},
})
$(el_window).close();
resolve(true);
}catch(err){
// Ignore
}
})