From 93e13cdb065d628d70731e64fae985c7e7ceb690 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 1 May 2024 16:36:00 +0100 Subject: [PATCH] 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 --- src/UI/UIWindowDesktopBGSettings.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/UI/UIWindowDesktopBGSettings.js b/src/UI/UIWindowDesktopBGSettings.js index 49bace6f3..45a253f51 100644 --- a/src/UI/UIWindowDesktopBGSettings.js +++ b/src/UI/UIWindowDesktopBGSettings.js @@ -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 } })