wip: osu! updating
This commit is contained in:
@@ -58,7 +58,9 @@ export const releaseStreamToReadable = (releaseStream: string) => {
|
||||
|
||||
export const compareBuildNumbers = (current: string, target: string): number => {
|
||||
const parse = (version: string): [number, number] => {
|
||||
const cleaned = version.split(/[^0-9.]/)[0];
|
||||
const cleaned = version.startsWith('b')
|
||||
? version.slice(1).split(/[^0-9.]/)[0]
|
||||
: version.split(/[^0-9.]/)[0];
|
||||
|
||||
const [baseStr, hotfixStr] = cleaned.split('.');
|
||||
const base = parseInt(baseStr, 10);
|
||||
|
@@ -145,7 +145,6 @@
|
||||
}
|
||||
|
||||
const versions = compareBuildNumbers($osuBuild, streamInfo);
|
||||
|
||||
if (versions > 0) {
|
||||
launchInfo = 'Update found!';
|
||||
await new Promise((res) => setTimeout(res, 1500));
|
||||
@@ -154,7 +153,8 @@
|
||||
} else {
|
||||
launchInfo = 'You are up to date!';
|
||||
}
|
||||
} catch {
|
||||
} catch(err) {
|
||||
console.log(err);
|
||||
toast.error('Hmmm...', {
|
||||
description: 'Failed to check for updates.',
|
||||
});
|
||||
|
Reference in New Issue
Block a user