chore: replace json config with database

This commit is contained in:
HorizonCode committed 2026-05-28 11:35:42 +02:00
1 parent 20e8389409
commit 871c40922e
2 files changed
+7 -9

No files matched your search

+2 -4
View File
@@ -27,7 +27,6 @@
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 { userAuth } from '$lib/userAuthentication';
import { import {
cursorSmoothening, cursorSmoothening,
customCursor, customCursor,
@@ -101,7 +100,7 @@
if (oldUserConfigExists) { if (oldUserConfigExists) {
const oldUserConfigValues = oldUserConfig.values(); const oldUserConfigValues = oldUserConfig.values();
if (Object.keys(oldUserConfigValues).length > 0) { if (Object.keys(oldUserConfigValues).length > 0) {
await config.value('setup_complete').set(true); await config.value<boolean>('setup_complete').set(true);
for (const key in oldUserConfigValues) { for (const key in oldUserConfigValues) {
const value = oldUserConfigValues[key]; const value = oldUserConfigValues[key];
@@ -126,7 +125,6 @@
const isSetupComplete = await config.value<boolean>('setup_complete').get(false); const isSetupComplete = await config.value<boolean>('setup_complete').get(false);
firstStartup.set(!isSetupComplete); firstStartup.set(!isSetupComplete);
$userAuth.init();
currentLoadingInfo.set('Loading config...'); currentLoadingInfo.set('Loading config...');
const config_theme = config.value<string>('theme'); const config_theme = config.value<string>('theme');
@@ -145,7 +143,7 @@
const lastThemeName = await config_theme.get('Default'); const lastThemeName = await config_theme.get('Default');
const last_theme = localThemes.find((t) => t.name === lastThemeName); const last_theme = localThemes.find((t) => t.name === lastThemeName);
if (!last_theme) { if (!last_theme) {
await config.value('theme').set('Default'); await config.value<string>('theme').set('Default');
loadTheme(localThemes[0], $custom_theme_container!, await config_theme_volume.get(0.15)); loadTheme(localThemes[0], $custom_theme_container!, await config_theme_volume.get(0.15));
} else { } else {
loadTheme(last_theme, $custom_theme_container!, await config_theme_volume.get(0.15)); loadTheme(last_theme, $custom_theme_container!, await config_theme_volume.get(0.15));
+5 -5
View File
@@ -683,8 +683,8 @@
description: `Welcome back, ${loginResult.user.name}!`, description: `Welcome back, ${loginResult.user.name}!`,
}); });
await Promise.all([ await Promise.all([
config.value<string>('username').set(username), config.value<string>('username').set(username, { encrypt: true }),
config.value<string>('password').set(password), config.value<string>('password').set(password, { encrypt: true }),
]); ]);
currentUser.set(loginResult.user); currentUser.set(loginResult.user);
@@ -816,7 +816,7 @@
} }
openTabletDriverPath.set(selectedPath); openTabletDriverPath.set(selectedPath);
await config.value('otd_path').set(selectedPath); await config.value<string>('otd_path').set(selectedPath);
sileo.success({ sileo.success({
title: 'Yay!', title: 'Yay!',
description: 'OpenTabletDriver set successfully.', description: 'OpenTabletDriver set successfully.',
@@ -1168,8 +1168,8 @@
class="text-destructive focus:text-destructive text-xs" class="text-destructive focus:text-destructive text-xs"
onclick={async () => { onclick={async () => {
await Promise.all([ await Promise.all([
config.value('username').set(''), config.value<string>('username').set(''),
config.value('password').set(''), config.value<string>('password').set(''),
]); ]);
sileo.success({ sileo.success({
title: 'Logout successful!', title: 'Logout successful!',