mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-28 18:46:09 +00:00
web/settings: move to state folder
This commit is contained in:
parent
4232c3437b
commit
1f0958a0d1
|
@ -6,7 +6,7 @@
|
|||
Value extends CobaltSettings[Context][Id]
|
||||
"
|
||||
>
|
||||
import settings, { updateSetting } from "$lib/settings";
|
||||
import settings, { updateSetting } from "$lib/state/settings";
|
||||
import type { CobaltSettings } from "$lib/types/settings";
|
||||
|
||||
export let settingContext: Context;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
Id extends keyof CobaltSettings[Context]
|
||||
"
|
||||
>
|
||||
import settings, { updateSetting } from "$lib/settings";
|
||||
import settings, { updateSetting } from "$lib/state/settings";
|
||||
import type { CobaltSettings } from "$lib/types/settings";
|
||||
|
||||
import Toggle from "$components/misc/Toggle.svelte";
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
import ActionButton from "$components/buttons/ActionButton.svelte";
|
||||
import SettingsButton from "$components/buttons/SettingsButton.svelte";
|
||||
|
||||
import { updateSetting } from "$lib/settings";
|
||||
import { updateSetting } from "$lib/state/settings";
|
||||
import type { DownloadModeOption } from "$lib/types/settings";
|
||||
|
||||
import IconSparkles from "$lib/icons/Sparkles.svelte";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import settings from "$lib/settings";
|
||||
import settings from "$lib/state/settings";
|
||||
import { device } from "$lib/device";
|
||||
import { locale, locales } from "$lib/i18n/translations";
|
||||
import { locale } from "$lib/i18n/translations";
|
||||
|
||||
import SettingsToggle from "$components/buttons/SettingsToggle.svelte";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import settings, { updateSetting } from "$lib/settings";
|
||||
import settings, { updateSetting } from "$lib/state/settings";
|
||||
import { t, locale, locales } from "$lib/i18n/translations";
|
||||
|
||||
import languages from "$i18n/languages.json";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { get } from 'svelte/store';
|
||||
import settings from "$lib/settings";
|
||||
import settings from "$lib/state/settings";
|
||||
import type { CobaltAPIResponse } from "$lib/types/api";
|
||||
|
||||
const apiURL = "https://api.cobalt.tools";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { derived, readable, type Updater } from 'svelte/store';
|
||||
import { merge } from 'ts-deepmerge';
|
||||
|
||||
import type { RecursivePartial } from './types/generic';
|
||||
import type { CobaltSettings } from './types/settings';
|
||||
import type { RecursivePartial } from '../types/generic';
|
||||
import type { CobaltSettings } from '../types/settings';
|
||||
|
||||
import defaultSettings from './settings/defaults';
|
||||
import defaultSettings from '../settings/defaults';
|
||||
|
||||
type PartialSettings = RecursivePartial<CobaltSettings>;
|
||||
type PartialSettingsWithSchema = RecursivePartial<CobaltSettings> & { schemaVersion: number };
|
|
@ -1,6 +1,6 @@
|
|||
import { readable, derived, type Readable } from 'svelte/store';
|
||||
|
||||
import settings from '$lib/settings';
|
||||
import settings from '$lib/state/settings';
|
||||
import { themeOptions } from '$lib/types/settings';
|
||||
|
||||
type Theme = typeof themeOptions[number];
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import "@fontsource/ibm-plex-mono/400.css";
|
||||
import "@fontsource/ibm-plex-mono/500.css";
|
||||
|
||||
import settings from "$lib/settings";
|
||||
import settings from "$lib/state/settings";
|
||||
import { device, app } from "$lib/device";
|
||||
import currentTheme, { statusBarColors } from "$lib/state/theme";
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ export const load: Load = async ({ url }) => {
|
|||
|
||||
if (browser) {
|
||||
const device = (await import('$lib/device')).device;
|
||||
const settings = get((await import('$lib/settings')).default);
|
||||
const settings = get((await import('$lib/state/settings')).default);
|
||||
const deviceLanguage = device.prefers.language;
|
||||
const settingsLanguage = settings.appearance.language;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { page } from "$app/stores";
|
||||
|
||||
import settings from "$lib/settings";
|
||||
import settings from "$lib/state/settings";
|
||||
|
||||
import { t } from "$lib/i18n/translations";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { device, app } from "$lib/device";
|
||||
import { version } from "$lib/version";
|
||||
import settings, { storedSettings } from "$lib/settings";
|
||||
import settings, { storedSettings } from "$lib/state/settings";
|
||||
|
||||
import { goto } from "$app/navigation";
|
||||
import { defaultSettingsPage } from "$lib/settings/defaults";
|
||||
|
|
Loading…
Reference in a new issue