forked from akanyan/STARTLINER
feat: less bad launches
This commit is contained in:
20
src/util.ts
20
src/util.ts
@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user