fix: ahead value read
This commit is contained in:
2 files changed
+33
-40
No files matched your search
@@ -27,13 +27,7 @@
|
|||||||
import { exit, getLauncherVersion, getPlatform } from '$lib/osuUtil';
|
import { exit, getLauncherVersion, getPlatform } from '$lib/osuUtil';
|
||||||
import * as presence from '$lib/presence';
|
import * as presence from '$lib/presence';
|
||||||
import { getDownloadableThemes, getThemes, loadTheme } from '$lib/themes';
|
import { getDownloadableThemes, getThemes, loadTheme } from '$lib/themes';
|
||||||
import {
|
import { cursorSmoothening, customCursor, patch, reduceAnimations } from '$lib/userSettings';
|
||||||
cursorSmoothening,
|
|
||||||
customCursor,
|
|
||||||
osuInstallationPath,
|
|
||||||
patch,
|
|
||||||
reduceAnimations,
|
|
||||||
} from '$lib/userSettings';
|
|
||||||
import { trackMediaContainer } from '$lib/utils';
|
import { trackMediaContainer } from '$lib/utils';
|
||||||
import '../app.css';
|
import '../app.css';
|
||||||
import { Buffer } from 'buffer';
|
import { Buffer } from 'buffer';
|
||||||
@@ -133,7 +127,6 @@
|
|||||||
const config_custom_cursor = config.value<boolean>('custom_cursor');
|
const config_custom_cursor = config.value<boolean>('custom_cursor');
|
||||||
const config_cursor_smoothening = config.value<boolean>('cursor_smoothening');
|
const config_cursor_smoothening = config.value<boolean>('cursor_smoothening');
|
||||||
const config_reduce_animations = config.value<boolean>('reduce_animations');
|
const config_reduce_animations = config.value<boolean>('reduce_animations');
|
||||||
const config_osu_installation_path = config.value<string>('osu_installation_path');
|
|
||||||
const config_discord_presence = config.value<boolean>('discord_presence');
|
const config_discord_presence = config.value<boolean>('discord_presence');
|
||||||
const config_tracking_enabled = config.value<boolean>('tracking_consent');
|
const config_tracking_enabled = config.value<boolean>('tracking_consent');
|
||||||
const config_otd_enabled = config.value<boolean>('otd_enabled');
|
const config_otd_enabled = config.value<boolean>('otd_enabled');
|
||||||
@@ -154,7 +147,6 @@
|
|||||||
customCursor.set(await config_custom_cursor.get(true));
|
customCursor.set(await config_custom_cursor.get(true));
|
||||||
cursorSmoothening.set(await config_cursor_smoothening.get(true));
|
cursorSmoothening.set(await config_cursor_smoothening.get(true));
|
||||||
reduceAnimations.set(await config_reduce_animations.get(false));
|
reduceAnimations.set(await config_reduce_animations.get(false));
|
||||||
osuInstallationPath.set(await config_osu_installation_path.get(''));
|
|
||||||
discordPresence.set(await config_discord_presence.get(true));
|
discordPresence.set(await config_discord_presence.get(true));
|
||||||
openTabletDriverEnabled.set(await config_otd_enabled.get(false));
|
openTabletDriverEnabled.set(await config_otd_enabled.get(false));
|
||||||
openTabletDriverPath.set(await config_otd_path.get(''));
|
openTabletDriverPath.set(await config_otd_path.get(''));
|
||||||
@@ -167,7 +159,6 @@
|
|||||||
cursorSmoothening.subscribe(async (val) => await config_cursor_smoothening.set(val));
|
cursorSmoothening.subscribe(async (val) => await config_cursor_smoothening.set(val));
|
||||||
reduceAnimations.subscribe(async (val) => await config_reduce_animations.set(val));
|
reduceAnimations.subscribe(async (val) => await config_reduce_animations.set(val));
|
||||||
openTabletDriverEnabled.subscribe(async (val) => config_otd_enabled.set(val));
|
openTabletDriverEnabled.subscribe(async (val) => config_otd_enabled.set(val));
|
||||||
osuInstallationPath.subscribe(async (val) => await config_osu_installation_path.set(val));
|
|
||||||
|
|
||||||
discordPresence.subscribe(async (val) => {
|
discordPresence.subscribe(async (val) => {
|
||||||
config_discord_presence.set(val);
|
config_discord_presence.set(val);
|
||||||
|
|||||||
+32
-30
@@ -133,38 +133,40 @@
|
|||||||
|
|
||||||
if (!$firstStartup) {
|
if (!$firstStartup) {
|
||||||
currentLoadingInfo.set('Checking osu installation path...');
|
currentLoadingInfo.set('Checking osu installation path...');
|
||||||
if ($osuInstallationPath && $osuInstallationPath.length > 0) {
|
const config_osu_installation_path = config.value<string>('osu_installation_path');
|
||||||
const validFolder = await isValidOsuFolder($osuInstallationPath);
|
const osuInstallationPathVal = await config_osu_installation_path.get('');
|
||||||
if (!validFolder) {
|
console.log('Checking osu! installation path:', osuInstallationPath);
|
||||||
await config.value<string>('osu_installation_path').set('');
|
const validFolder = await isValidOsuFolder(osuInstallationPathVal);
|
||||||
osuInstallationPath.set('');
|
if (!validFolder) {
|
||||||
sileo.error({
|
await config_osu_installation_path.set('');
|
||||||
title: 'Hmm...',
|
osuInstallationPath.set('');
|
||||||
description: 'Your previously set osu! installation path seems to be invalid.',
|
sileo.error({
|
||||||
});
|
title: 'Hmm...',
|
||||||
|
description: 'Your previously set osu! installation path seems to be invalid.',
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
osuInstallationPath.set(osuInstallationPathVal);
|
||||||
|
currentLoadingInfo.set('Getting osu version...');
|
||||||
|
const osuReleaseStream = await getReleaseStream($osuInstallationPath);
|
||||||
|
osuStream.set(osuReleaseStream);
|
||||||
|
const osuVersion = await getVersion($osuInstallationPath);
|
||||||
|
osuBuild.set(osuVersion);
|
||||||
|
|
||||||
|
currentLoadingInfo.set('Counting beatmapsets...');
|
||||||
|
const beatmapSetCount = await getBeatmapSetsCount($osuInstallationPath);
|
||||||
|
if (beatmapSetCount !== null) beatmapSets.set(beatmapSetCount);
|
||||||
|
|
||||||
|
currentLoadingInfo.set('Counting skins...');
|
||||||
|
const skins_list = await getSkins($osuInstallationPath);
|
||||||
|
if (skins_list) {
|
||||||
|
skins.set(skins_list);
|
||||||
|
skinsCount.set(skins_list.length);
|
||||||
} else {
|
} else {
|
||||||
currentLoadingInfo.set('Getting osu version...');
|
skinsCount.set(0);
|
||||||
const osuReleaseStream = await getReleaseStream($osuInstallationPath);
|
|
||||||
osuStream.set(osuReleaseStream);
|
|
||||||
const osuVersion = await getVersion($osuInstallationPath);
|
|
||||||
osuBuild.set(osuVersion);
|
|
||||||
|
|
||||||
currentLoadingInfo.set('Counting beatmapsets...');
|
|
||||||
const beatmapSetCount = await getBeatmapSetsCount($osuInstallationPath);
|
|
||||||
if (beatmapSetCount !== null) beatmapSets.set(beatmapSetCount);
|
|
||||||
|
|
||||||
currentLoadingInfo.set('Counting skins...');
|
|
||||||
const skins_list = await getSkins($osuInstallationPath);
|
|
||||||
if (skins_list) {
|
|
||||||
skins.set(skins_list);
|
|
||||||
skinsCount.set(skins_list.length);
|
|
||||||
} else {
|
|
||||||
skinsCount.set(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
const skin: string = await getSkin($osuInstallationPath);
|
|
||||||
currentSkin.set(skin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const skin: string = await getSkin($osuInstallationPath);
|
||||||
|
currentSkin.set(skin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user