updates: sort updates by name
This commit is contained in:
parent
9ce726b83d
commit
92c278f844
1 changed files with 3 additions and 0 deletions
|
|
@ -146,6 +146,9 @@ export default class Updates extends GObject.Object {
|
||||||
if (data.errors.length > 0 && data.repos.length === 0) {
|
if (data.errors.length > 0 && data.repos.length === 0) {
|
||||||
this.#updateFromCache().catch(console.error);
|
this.#updateFromCache().catch(console.error);
|
||||||
} else {
|
} else {
|
||||||
|
// Sort updates by name
|
||||||
|
for (const repo of data.repos) repo.updates.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
|
|
||||||
// Cache and set
|
// Cache and set
|
||||||
writeFileAsync(this.#cachePath, JSON.stringify({ cached: true, ...data })).catch(console.error);
|
writeFileAsync(this.#cachePath, JSON.stringify({ cached: true, ...data })).catch(console.error);
|
||||||
this.#data = data;
|
this.#data = data;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue