Skip to content

Commit

Permalink
6.1.99
Browse files Browse the repository at this point in the history
🐞 修正
eslint error & warning
  • Loading branch information
yayacat committed Apr 4, 2024
1 parent 6297ed2 commit 9521298
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions TREM.Electron/js/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@ TREM.Report = {
});
} else {
if (document.getElementById("report-replay-downloader-icon")) document.getElementById("report-replay-downloader-icon").innerText = "download";

if (document.getElementById("report-replay-downloader-text")) document.getElementById("report-replay-downloader-text").innerText = "下載";
report.download = false;
this.cache.set(report.id, report);
Expand Down
25 changes: 15 additions & 10 deletions TREM.Electron/js/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -1966,53 +1966,56 @@ let keyhave = false;

async function exptechlogin() {
const EMAIL = document.getElementById("exptech.email").value;

if (!keyhave) {
const PASS = document.getElementById("exptech.pass").value;
const NAME = `${document.getElementById("exptech.name").value}/TREMV/${app.getVersion()}/${os.release()}`;
// console.log(EMAIL);
// console.log(PASS);
// console.log(NAME);
const key = await login({ email: EMAIL, pass: PASS, name: NAME });

if (key != "") {
showDialog("success",
TREM.Localization.getString("exptech_login_Title"),
TREM.Localization.getString("exptech_login_success"),
0, "check", () => {
ipcRenderer.send("config:value", "exptech.key", key);
},"OK","",() => void 0,0,0,() => {
}, "OK", "", () => void 0, 0, 0, () => {
ipcRenderer.send("config:value", "exptech.key", key);
});
// 選取按鈕元素
var button = document.getElementById('exptech.login');
const button = document.getElementById("exptech.login");

// 選取 <span> 元素
var span = button.querySelector('.filled-tonal-button-label > span');
const span = button.querySelector(".filled-tonal-button-label > span");

// 更改 <span> 文字
span.textContent = '登出';
span.textContent = "登出";
keyhave = true;
}
} else if (setting["exptech.key"]) {
const KEY = setting["exptech.key"];
const out = await logout({ email: EMAIL, key: KEY });

if (out != "") {
console.log("ok");
showDialog("success",
TREM.Localization.getString("exptech_logout_Title"),
TREM.Localization.getString("exptech_logout_success"),
0, "check", () => {
ipcRenderer.send("config:value", "exptech.key", "");
},"OK","",() => void 0,0,0,() => {
}, "OK", "", () => void 0, 0, 0, () => {
ipcRenderer.send("config:value", "exptech.key", "");
});
// 選取按鈕元素
var button = document.getElementById('exptech.login');
const button = document.getElementById("exptech.login");

// 選取 <span> 元素
var span = button.querySelector('.filled-tonal-button-label > span');
const span = button.querySelector(".filled-tonal-button-label > span");

// 更改 <span> 文字
span.textContent = '登入';
span.textContent = "登入";
keyhave = false;
}
}
Expand All @@ -2029,6 +2032,7 @@ async function login(data) {
body : JSON.stringify(data),
});
const ans = await response.text();

if (!response.ok) throw new Error(`${response.status} ${ans}`);
return ans;
} catch (err) {
Expand All @@ -2039,7 +2043,7 @@ async function login(data) {
0, "error", () => {
const key = "";
ipcRenderer.send("config:value", "exptech.key", key);
},"OK","",() => void 0,0,0,() => {
}, "OK", "", () => void 0, 0, 0, () => {
const key = "";
ipcRenderer.send("config:value", "exptech.key", key);
});
Expand All @@ -2055,14 +2059,15 @@ async function logout(data) {
body : JSON.stringify(data),
});
const ans = await response.text();

if (!response.ok) throw new Error(`${response.status} ${ans}`);
return ans;
} catch (err) {
console.log(err);
showDialog("error",
TREM.Localization.getString("exptech_logout_Title"),
TREM.Localization.getString("exptech_logout_error"),
0, "error", () => void 0,"OK","",() => void 0,0,0,() => void 0);
0, "error", () => void 0, "OK", "", () => void 0, 0, 0, () => void 0);
return "";
}
}
Expand Down

0 comments on commit 9521298

Please sign in to comment.