chore: replace json config with database

This commit is contained in:
2026-05-28 11:35:42 +02:00
parent 20e8389409
commit 871c40922e
2 changed files with 7 additions and 9 deletions
+2 -4
View File
@@ -27,7 +27,6 @@
import { exit, getLauncherVersion, getPlatform } from '$lib/osuUtil';
import * as presence from '$lib/presence';
import { getDownloadableThemes, getThemes, loadTheme } from '$lib/themes';
import { userAuth } from '$lib/userAuthentication';
import {
cursorSmoothening,
customCursor,
@@ -101,7 +100,7 @@
if (oldUserConfigExists) {
const oldUserConfigValues = oldUserConfig.values();
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) {
const value = oldUserConfigValues[key];
@@ -126,7 +125,6 @@
const isSetupComplete = await config.value<boolean>('setup_complete').get(false);
firstStartup.set(!isSetupComplete);
$userAuth.init();
currentLoadingInfo.set('Loading config...');
const config_theme = config.value<string>('theme');
@@ -145,7 +143,7 @@
const lastThemeName = await config_theme.get('Default');
const last_theme = localThemes.find((t) => t.name === lastThemeName);
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));
} else {
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}!`,
});
await Promise.all([
config.value<string>('username').set(username),
config.value<string>('password').set(password),
config.value<string>('username').set(username, { encrypt: true }),
config.value<string>('password').set(password, { encrypt: true }),
]);
currentUser.set(loginResult.user);
@@ -816,7 +816,7 @@
}
openTabletDriverPath.set(selectedPath);
await config.value('otd_path').set(selectedPath);
await config.value<string>('otd_path').set(selectedPath);
sileo.success({
title: 'Yay!',
description: 'OpenTabletDriver set successfully.',
@@ -1168,8 +1168,8 @@
class="text-destructive focus:text-destructive text-xs"
onclick={async () => {
await Promise.all([
config.value('username').set(''),
config.value('password').set(''),
config.value<string>('username').set(''),
config.value<string>('password').set(''),
]);
sileo.success({
title: 'Logout successful!',