misc: change $site to a $state
This commit is contained in:
85 files changed
+153
-140
No files matched your search
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import type { PostView } from 'lemmy-js-client'
|
||||
import PostVote from './PostVote.svelte'
|
||||
import { site } from '$lib/lemmy.js'
|
||||
import { site } from '$lib/lemmy.svelte.js'
|
||||
import {
|
||||
ArrowsUpDown,
|
||||
ArrowTopRightOnSquare,
|
||||
@@ -419,7 +419,7 @@
|
||||
</MenuButton>
|
||||
{/if}
|
||||
{#if profile.data.user?.local_user_view.person.id != post.creator.id}
|
||||
{#if feature('hidePosts', $site?.version)}
|
||||
{#if feature('hidePosts', site.data?.version)}
|
||||
<MenuButton
|
||||
onclick={async () => {
|
||||
if (!profile.data?.jwt) return
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { vote as voteItem } from '$lib/lemmy/contentview.js'
|
||||
import { Button, Popover, buttonColor, toast } from 'mono-svelte'
|
||||
import { site } from '$lib/lemmy.js'
|
||||
import { site } from '$lib/lemmy.svelte.js'
|
||||
import { fade, fly } from 'svelte/transition'
|
||||
import { backOut } from 'svelte/easing'
|
||||
import { t } from '$lib/translations'
|
||||
@@ -106,7 +106,7 @@
|
||||
</span>
|
||||
{/if}
|
||||
</button>
|
||||
{#if $site?.site_view.local_site.enable_downvotes ?? true}
|
||||
{#if site.data?.site_view.local_site.enable_downvotes ?? true}
|
||||
<button
|
||||
onclick={() => castVote(vote == -1 ? 0 : -1)}
|
||||
class="flex items-center flex-row-reverse gap-0.5 transition-colors
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
} from '@tanstack/svelte-virtual'
|
||||
import { afterNavigate, beforeNavigate } from '$app/navigation'
|
||||
import { combineCrossposts } from './crosspost.svelte'
|
||||
import { client } from '$lib/lemmy'
|
||||
import { client } from '$lib/lemmy.svelte'
|
||||
import {
|
||||
postFeeds,
|
||||
type PostFeed,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { run, preventDefault } from 'svelte/legacy'
|
||||
|
||||
import { createEventDispatcher, onDestroy, onMount } from 'svelte'
|
||||
import { client, site } from '$lib/lemmy.js'
|
||||
import { client, site } from '$lib/lemmy.svelte.js'
|
||||
import type { Community, Post, PostView } from 'lemmy-js-client'
|
||||
import { Select, Spinner, Switch, toast } from 'mono-svelte'
|
||||
import {
|
||||
@@ -433,7 +433,7 @@
|
||||
{/if}
|
||||
<Switch bind:checked={data.nsfw}>{$t('form.post.nsfw')}</Switch>
|
||||
{#if data.language_id !== undefined}
|
||||
{#if $site}
|
||||
{#if site.data}
|
||||
<Select
|
||||
class="w-max"
|
||||
label={$t('settings.app.lang.title')}
|
||||
@@ -443,7 +443,7 @@
|
||||
<Icon src={XMark} size="16" micro />
|
||||
{$t('form.post.unset')}
|
||||
</Option>
|
||||
{#each $site?.all_languages as language}
|
||||
{#each site.data?.all_languages as language}
|
||||
<Option value={language.id.toString()}>{language.name}</Option>
|
||||
{/each}
|
||||
</Select>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { profile } from '$lib/auth.svelte'
|
||||
import { client } from '$lib/lemmy.js'
|
||||
import { client } from '$lib/lemmy.svelte.js'
|
||||
import type { View } from '$lib/settings.svelte'
|
||||
import { isImage, isVideo } from '$lib/ui/image'
|
||||
import { canParseUrl, findClosestNumber } from '$lib/util.svelte'
|
||||
|
||||
Reference in new issue
Block a user