summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-26 17:20:16 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-26 17:20:16 +1100
commit92c278f8440d9a4e08c0019c5c9452da6fb97aaf (patch)
treea909c7e4bbbff0522be7961bbc93d0ce2cffcd55
parentupdates: better styles (diff)
downloadcaelestia-shell-92c278f8440d9a4e08c0019c5c9452da6fb97aaf.tar.gz
caelestia-shell-92c278f8440d9a4e08c0019c5c9452da6fb97aaf.tar.bz2
caelestia-shell-92c278f8440d9a4e08c0019c5c9452da6fb97aaf.zip
updates: sort updates by name
-rw-r--r--src/services/updates.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/services/updates.ts b/src/services/updates.ts
index dc82080..8477733 100644
--- a/src/services/updates.ts
+++ b/src/services/updates.ts
@@ -146,6 +146,9 @@ export default class Updates extends GObject.Object {
if (data.errors.length > 0 && data.repos.length === 0) {
this.#updateFromCache().catch(console.error);
} else {
+ // Sort updates by name
+ for (const repo of data.repos) repo.updates.sort((a, b) => a.name.localeCompare(b.name));
+
// Cache and set
writeFileAsync(this.#cachePath, JSON.stringify({ cached: true, ...data })).catch(console.error);
this.#data = data;