feat: less bad launches

This commit is contained in:
2025-02-23 23:48:00 +01:00
parent fcd3855c49
commit 70b8b3ae55
27 changed files with 145 additions and 34 deletions

View File

@ -20,3 +20,23 @@ export const changePrimaryColor = (game: 'Ongeki' | 'Chunithm') => {
};
export const pkgKey = (pkg: Package) => `${pkg.namespace}-${pkg.name}`;
export const needsUpdate = (pkg: Package | undefined) => {
const loc = pkg?.loc?.version;
const rmt = pkg?.rmt?.version;
if (loc === undefined || rmt === undefined) {
return false;
}
const [l1, l2, l3] = loc.split('.');
const [r1, r2, r3] = rmt.split('.');
if (l1 === r1) {
if (l2 === r2) {
return l3 < r3;
}
return l2 < r2;
}
return l1 < r1;
};