Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚩 PR: Added remote firmware check #768

Merged
merged 10 commits into from
Jul 24, 2024
Prev Previous commit
Next Next commit
Initial solution of firmware check
  • Loading branch information
elsoazemelet committed Jul 5, 2024
commit dd952b0de7ba8d41c05df0352cc41bd393491b4c
42 changes: 35 additions & 7 deletions src/renderer/runtime/app-helper.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ function createAppSettingsStore(persistent) {
intervalPause: false,
firmwareNotificationState: 0,
firmware_d51_required: {
major: 0,
minor: 0,
patch: 0,
major: 666,
minor: 666,
patch: 666,
},
firmware_esp32_required: {
major: 0,
minor: 0,
patch: 0,
major: 666,
minor: 666,
patch: 666,
},
sizeChange: 0,
activeWindowResult: {
Expand Down Expand Up @@ -225,7 +225,35 @@ async function init_appsettings() {
await window.electron
.fetchUrlJSON(configuration.FIRMWARE_JSON_URL)
.then((res) => {
console.log(res);
for (const obj of res) {
const { ARCHITECTURE, MAJOR, MINOR, PATCH } = obj;
switch (ARCHITECTURE) {
case "esp32":
appSettings.update((store) => {
store.firmware_esp32_required = {
major: MAJOR,
minor: MINOR,
patch: PATCH,
};
return store;
});
break;
case "d51":
appSettings.update((store) => {
store.firmware_d51_required = {
major: MAJOR,
minor: MINOR,
patch: PATCH,
};
return store;
});
break;
default:
console.warn(
`Unknown required firmware: ${ARCHITECTURE} ${MAJOR}.${MINOR}.${PATCH}`
);
}
}
})
.catch((e) => {
console.error(e);
Expand Down
Loading