settings: show updates at top if one available

This commit is contained in:
Harvey Tindall
2025-11-24 18:43:08 +00:00
parent 8f3b860cc7
commit 607d8e9566

View File

@@ -1043,6 +1043,21 @@ export class settingsList {
icon.classList.add("button", "~urge");
icon.innerHTML = `<i class="ri-download-line" title="${window.lang.strings("update")}"></i>`;
icon.onclick = () => window.updater.checkForUpdates(window.modals.updateInfo.show);
// Put us first
if ("order" in this._settings && this._settings.order) {
let i = -1;
for (let j = 0; j < this._settings.order.length; j++) {
const member = this._settings.order[j];
if ("section" in member && member.section == "updates") {
i = j;
break;
}
}
if (i != -1) {
this._settings.order.splice(i, 1);
this._settings.order.unshift({ section: "updates" });
}
}
}
this.addSection(section.section, section, icon);
} else if (section.section == "matrix" && !window.matrixEnabled) {