migrate: change settings from a store to a state

This commit is contained in:
Xylight committed 2024-10-25 21:09:32 -07:00
1 parent ffcd9faa96
commit d597349887
128 files changed
+1010 -1144

No files matched your search

@@ -66,7 +66,7 @@
</script>
<script lang="ts">
import { profile } from '$lib/auth.js'
import { profile } from '$lib/auth.svelte.js'
import {
amMod,
isAdmin,
@@ -85,7 +85,7 @@
} from 'mono-svelte'
import { client, getClient } from '$lib/lemmy.js'
import { addSubscription } from '$lib/lemmy/user.js'
import { fullCommunityName } from '$lib/util.js'
import { fullCommunityName } from '$lib/util.svelte.js'
import type { CommunityModeratorView, CommunityView } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import {
@@ -109,7 +109,7 @@
import { userLink } from '$lib/lemmy/generic'
import { t } from '$lib/translations'
import Entity from '$lib/components/ui/Entity.svelte'
import { userSettings } from '$lib/settings'
import { settings } from '$lib/settings.svelte'
let loading = $state({
blocking: false,
@@ -170,7 +170,7 @@
<div class="flex flex-col gap-1">
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
<Expandable bind:open={$userSettings.expand.about} class="!pt-0">
<Expandable bind:open={settings.expand.about} class="!pt-0">
{#snippet title()}
<span class="py-1 px-1 flex gap-1 items-center">
<Icon src={InformationCircle} size="15" mini />
@@ -181,7 +181,7 @@
</Expandable>
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
<Expandable bind:open={$userSettings.expand.stats}>
<Expandable bind:open={settings.expand.stats}>
{#snippet title()}
<span class="py-1 px-1 flex gap-1 items-center">
<Icon src={ChartBar} size="15" mini />
@@ -204,7 +204,7 @@
{#if moderators && moderators.length > 0}
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
<Expandable bind:open={$userSettings.expand.team}>
<Expandable bind:open={settings.expand.team}>
{#snippet title()}
<span class="py-1 px-1 flex gap-1 items-center">
<ShieldIcon width={15} filled />
@@ -2,13 +2,13 @@
import { preventDefault } from 'svelte/legacy'
import { goto } from '$app/navigation'
import { profile } from '$lib/auth.js'
import { profile } from '$lib/auth.svelte.js'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { ImageInput, Switch, toast } from 'mono-svelte'
import { client, getClient } from '$lib/lemmy.js'
import { addSubscription } from '$lib/lemmy/user.js'
import { Button, Checkbox, TextInput } from 'mono-svelte'
import { uploadImage } from '$lib/util.js'
import { uploadImage } from '$lib/util.svelte.js'
import { t } from '$lib/translations'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import ImagePreviewInput from '$lib/components/input/ImagePreviewInput.svelte'
@@ -1,8 +1,8 @@
<script lang="ts">
import { profile } from '$lib/auth'
import { profile } from '$lib/auth.svelte'
import EntityHeader from '$lib/components/ui/EntityHeader.svelte'
import { t } from '$lib/translations'
import { fullCommunityName } from '$lib/util'
import { fullCommunityName } from '$lib/util.svelte'
import type {
Community,
CommunityAggregates,
@@ -13,8 +13,8 @@
} from 'svelte-hero-icons'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { Button, Modal } from 'mono-svelte'
import { fullCommunityName, isSubscribed } from '$lib/util.js'
import { profile } from '$lib/auth.js'
import { fullCommunityName, isSubscribed } from '$lib/util.svelte.js'
import { profile } from '$lib/auth.svelte.js'
import { addSubscription } from '$lib/lemmy/user.js'
import Avatar from '$lib/components/ui/Avatar.svelte'
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
@@ -1,6 +1,6 @@
<script lang="ts">
import Avatar from '$lib/components/ui/Avatar.svelte'
import { userSettings } from '$lib/settings.js'
import { settings } from '$lib/settings.svelte.js'
import { t } from '$lib/translations'
import type { Community } from 'lemmy-js-client'
import { ExclamationTriangle, Icon } from 'svelte-hero-icons'
@@ -23,7 +23,7 @@
avatar = false,
name = true,
avatarSize = 24,
showInstance = $userSettings.showInstances.community,
showInstance = settings.showInstances.community,
displayName = true,
badges = {
nsfw: false,