fix: ahead value read
This commit is contained in:
@@ -27,13 +27,7 @@
|
||||
import { exit, getLauncherVersion, getPlatform } from '$lib/osuUtil';
|
||||
import * as presence from '$lib/presence';
|
||||
import { getDownloadableThemes, getThemes, loadTheme } from '$lib/themes';
|
||||
import {
|
||||
cursorSmoothening,
|
||||
customCursor,
|
||||
osuInstallationPath,
|
||||
patch,
|
||||
reduceAnimations,
|
||||
} from '$lib/userSettings';
|
||||
import { cursorSmoothening, customCursor, patch, reduceAnimations } from '$lib/userSettings';
|
||||
import { trackMediaContainer } from '$lib/utils';
|
||||
import '../app.css';
|
||||
import { Buffer } from 'buffer';
|
||||
@@ -133,7 +127,6 @@
|
||||
const config_custom_cursor = config.value<boolean>('custom_cursor');
|
||||
const config_cursor_smoothening = config.value<boolean>('cursor_smoothening');
|
||||
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_tracking_enabled = config.value<boolean>('tracking_consent');
|
||||
const config_otd_enabled = config.value<boolean>('otd_enabled');
|
||||
@@ -154,7 +147,6 @@
|
||||
customCursor.set(await config_custom_cursor.get(true));
|
||||
cursorSmoothening.set(await config_cursor_smoothening.get(true));
|
||||
reduceAnimations.set(await config_reduce_animations.get(false));
|
||||
osuInstallationPath.set(await config_osu_installation_path.get(''));
|
||||
discordPresence.set(await config_discord_presence.get(true));
|
||||
openTabletDriverEnabled.set(await config_otd_enabled.get(false));
|
||||
openTabletDriverPath.set(await config_otd_path.get(''));
|
||||
@@ -167,7 +159,6 @@
|
||||
cursorSmoothening.subscribe(async (val) => await config_cursor_smoothening.set(val));
|
||||
reduceAnimations.subscribe(async (val) => await config_reduce_animations.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) => {
|
||||
config_discord_presence.set(val);
|
||||
|
||||
+32
-30
@@ -133,38 +133,40 @@
|
||||
|
||||
if (!$firstStartup) {
|
||||
currentLoadingInfo.set('Checking osu installation path...');
|
||||
if ($osuInstallationPath && $osuInstallationPath.length > 0) {
|
||||
const validFolder = await isValidOsuFolder($osuInstallationPath);
|
||||
if (!validFolder) {
|
||||
await config.value<string>('osu_installation_path').set('');
|
||||
osuInstallationPath.set('');
|
||||
sileo.error({
|
||||
title: 'Hmm...',
|
||||
description: 'Your previously set osu! installation path seems to be invalid.',
|
||||
});
|
||||
const config_osu_installation_path = config.value<string>('osu_installation_path');
|
||||
const osuInstallationPathVal = await config_osu_installation_path.get('');
|
||||
console.log('Checking osu! installation path:', osuInstallationPath);
|
||||
const validFolder = await isValidOsuFolder(osuInstallationPathVal);
|
||||
if (!validFolder) {
|
||||
await config_osu_installation_path.set('');
|
||||
osuInstallationPath.set('');
|
||||
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 {
|
||||
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 {
|
||||
skinsCount.set(0);
|
||||
}
|
||||
|
||||
const skin: string = await getSkin($osuInstallationPath);
|
||||
currentSkin.set(skin);
|
||||
skinsCount.set(0);
|
||||
}
|
||||
|
||||
const skin: string = await getSkin($osuInstallationPath);
|
||||
currentSkin.set(skin);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user