mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-09-28 12:31:14 +02:00
Compare commits
2 Commits
copilot/fi
...
1.6.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac1d74ff23 | ||
|
|
7f86d46ae7 |
@@ -35,10 +35,17 @@ async function sendReport(params) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetch(process.env.BUG_REPORT_URL, {
|
const reportUrl = process.env.BUG_REPORT_URL;
|
||||||
|
const reportApiKey = process.env.BUG_REPORT_API_KEY;
|
||||||
|
|
||||||
|
if (!reportUrl || !reportApiKey) {
|
||||||
|
throw new Error("Bug report service is not configured. Missing BUG_REPORT_URL or BUG_REPORT_API_KEY on backend.");
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(reportUrl, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"X-Api-Key": process.env.BUG_REPORT_API_KEY
|
"X-Api-Key": reportApiKey
|
||||||
},
|
},
|
||||||
body: formData
|
body: formData
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -45,13 +45,32 @@ async function initUpdateUI() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
btn.onclick = () => {
|
const initialButtonText = btn.textContent;
|
||||||
window.electronAPI.downloadUpdate();
|
const initialIconText = icon.textContent;
|
||||||
|
const initialTitleText = title.textContent;
|
||||||
|
const initialSubText = sub.textContent;
|
||||||
|
|
||||||
|
btn.onclick = async () => {
|
||||||
|
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
btn.textContent = "Downloading...";
|
btn.textContent = "Downloading...";
|
||||||
icon.textContent = "download";
|
icon.textContent = "download";
|
||||||
title.textContent = "Downloading update";
|
title.textContent = "Downloading update";
|
||||||
progressWrap.style.display = "flex";
|
progressWrap.style.display = "flex";
|
||||||
|
|
||||||
|
try {
|
||||||
|
await window.electronAPI.downloadUpdate();
|
||||||
|
} catch {
|
||||||
|
btn.disabled = false;
|
||||||
|
btn.textContent = initialButtonText;
|
||||||
|
icon.textContent = initialIconText;
|
||||||
|
title.textContent = initialTitleText;
|
||||||
|
sub.textContent = initialSubText;
|
||||||
|
progressWrap.style.display = "none";
|
||||||
|
progressFill.style.width = "0%";
|
||||||
|
progressPct.textContent = "0%";
|
||||||
|
progressEta.textContent = "";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.electronAPI.onDownloadProgress((progress) => {
|
window.electronAPI.onDownloadProgress((progress) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user