misc: change $site to a $state

This commit is contained in:
James Xylight committed 2025-02-09 11:17:01 -08:00
1 parent a94dd5f3d4
commit 8dcca84e60
85 files changed
+153 -140

No files matched your search

+13 -10
View File
@@ -26,7 +26,7 @@
import { Forward, Icon } from 'svelte-hero-icons'
import Shell from '$lib/components/ui/layout/Shell.svelte'
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
import { site } from '$lib/lemmy.js'
import { site } from '$lib/lemmy.svelte.js'
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
import { LINKED_INSTANCE_URL } from '$lib/instance'
import { locale } from '$lib/translations'
@@ -91,8 +91,8 @@
</script>
<svelte:head>
{#if $site?.site_view}
<title>{$site?.site_view.site.name}</title>
{#if site.data?.site_view}
<title>{site.data?.site_view.site.name}</title>
<meta
name="theme-color"
content={rgbToHex(
@@ -102,8 +102,11 @@
)}
/>
{#if LINKED_INSTANCE_URL}
<link rel="icon" href={$site?.site_view?.site.icon} />
<meta name="description" content={$site?.site_view?.site.description} />
<link rel="icon" href={site.data?.site_view?.site.icon} />
<meta
name="description"
content={site.data?.site_view?.site.description}
/>
{:else}
<meta name="description" content="A sleek client for Lemmy" />
{/if}
@@ -150,12 +153,12 @@
{#if page.data.slots?.sidebar?.component}
{@const SvelteComponent = page.data.slots.sidebar.component}
<SvelteComponent {...page.data.slots.sidebar.props} />
{:else if $site}
{:else if site.data}
<SiteCard
site={$site.site_view}
taglines={$site.taglines}
admins={$site.admins}
version={$site.version}
site={site.data.site_view}
taglines={site.data.taglines}
admins={site.data.admins}
version={site.data.version}
/>
{:else}
<div class="h-64 w-full grid place-items-center">
+2 -2
View File
@@ -5,7 +5,7 @@
import ViewSelect from '$lib/components/lemmy/dropdowns/ViewSelect.svelte'
import { searchParam } from '$lib/util.svelte.js'
import { ArrowRight, ChartBar, Icon } from 'svelte-hero-icons'
import { site } from '$lib/lemmy.js'
import { site } from '$lib/lemmy.svelte.js'
import Location from '$lib/components/lemmy/dropdowns/Location.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { t } from '$lib/translations.js'
@@ -77,7 +77,7 @@
<Icon src={ChartBar} size="16" mini />
{$t('routes.frontpage.footer', {
// @ts-ignore
users: $site?.site_view?.counts?.users_active_day ?? '??',
users: site.data?.site_view?.counts?.users_active_day ?? '??',
})}
</span>
</Pageination>
+1 -1
View File
@@ -1,4 +1,4 @@
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { settings } from '$lib/settings.svelte'
import type { GetPostsResponse, ListingType, SortType } from 'lemmy-js-client'
import { get, writable } from 'svelte/store'
@@ -1,5 +1,5 @@
import { profile } from '$lib/auth.svelte.js'
import { client } from '$lib/lemmy.js'
import { client } from '$lib/lemmy.svelte.js'
import { error, redirect } from '@sveltejs/kit'
export const ssr = false
+6 -8
View File
@@ -1,18 +1,16 @@
import { profile } from '$lib/auth.svelte'
import { get } from 'svelte/store'
import { getClient } from '$lib/lemmy.js'
import { site as siteStore } from '$lib/lemmy'
import { getClient } from '$lib/lemmy.svelte.js'
import { site as siteStore } from '$lib/lemmy.svelte.js'
export async function load({ fetch }) {
let site = get(siteStore)
let site = siteStore
if (!site) {
if (!site.data) {
const res = await getClient(undefined, fetch).getSite()
site = res
site.data = res
}
return {
site: site,
site: site.data,
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
import { profile } from '$lib/auth.svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { get } from 'svelte/store'
export async function load({ data, fetch, url }) {
@@ -3,7 +3,7 @@
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import { Material, toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import type {
ApproveRegistrationApplication,
RegistrationApplicationView,
+4 -4
View File
@@ -10,7 +10,7 @@
Switch,
toast,
} from 'mono-svelte'
import { getClient, site } from '$lib/lemmy.js'
import { getClient, site } from '$lib/lemmy.svelte.js'
import type { EditSite } from 'lemmy-js-client'
import type { PageData } from './$types.js'
import { Button, Checkbox, Select, TextInput } from 'mono-svelte'
@@ -246,7 +246,7 @@
<SectionTitle>{$t('form.profile.languages.title')}</SectionTitle>
<p>{$t('form.profile.languages.description')}</p>
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
{#if $site}
{#if site.data}
<div class="flex gap-2 flex-wrap flex-row">
<Menu class="gap-px">
{#snippet target()}
@@ -257,7 +257,7 @@
</Badge>
</button>
{/snippet}
{#each $site.all_languages.filter((l) => !formData.discussion_languages?.includes(l.id)) as language, index}
{#each site.data.all_languages.filter((l) => !formData.discussion_languages?.includes(l.id)) as language, index}
<MenuButton
class="min-h-[16px] py-0"
onclick={() => {
@@ -269,7 +269,7 @@
{/each}
</Menu>
{#each formData.discussion_languages ?? [] as languageId, index}
{@const language = $site.all_languages.find(
{@const language = site.data.all_languages.find(
(l) => l.id == languageId,
)}
<button
+1 -1
View File
@@ -6,7 +6,7 @@
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { t } from '$lib/translations.js'
import { trycatch } from '$lib/util.svelte.js'
import type { Instance } from 'lemmy-js-client'
+1 -1
View File
@@ -1,5 +1,5 @@
import { profile } from '$lib/auth.svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { get } from 'svelte/store'
export async function load({ fetch, parent }) {
+1 -1
View File
@@ -6,7 +6,7 @@
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import { toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import type { Tagline } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { Icon, Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons'
+1 -1
View File
@@ -6,7 +6,7 @@
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import { toast } from 'mono-svelte'
import { instance } from '$lib/instance.js'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { addAdmin } from '$lib/lemmy/user.js'
import { removeItem, trycatch } from '$lib/util.svelte.js'
import { Button, TextInput } from 'mono-svelte'
+1 -1
View File
@@ -1,5 +1,5 @@
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
export async function load(req: any) {
const community = await getClient(undefined, req.fetch).getCommunity({
+2 -2
View File
@@ -15,7 +15,7 @@
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import { t } from '$lib/translations.js'
import { settings } from '$lib/settings.svelte.js'
import { site } from '$lib/lemmy.js'
import { site } from '$lib/lemmy.svelte.js'
import { resumables } from '$lib/lemmy/item'
import CommunityHeader from '$lib/components/lemmy/community/CommunityHeader.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
@@ -141,7 +141,7 @@
<Icon src={ChartBar} size="16" mini />
{$t('routes.frontpage.footer', {
// @ts-ignore
users: $site?.site_view.counts.users_active_day ?? '??',
users: site.data?.site_view.counts.users_active_day ?? '??',
})}
</span>
</Pageination>
@@ -5,7 +5,7 @@
import type { PageData } from './$types.js'
import { profile } from '$lib/auth.svelte.js'
import { toast } from 'mono-svelte'
import { client, getClient } from '$lib/lemmy.js'
import { client, getClient } from '$lib/lemmy.svelte.js'
import { flip } from 'svelte/animate'
import { Button, TextInput } from 'mono-svelte'
import { t } from '$lib/translations.js'
+1 -1
View File
@@ -1,4 +1,4 @@
import { client } from '$lib/lemmy.js'
import { client } from '$lib/lemmy.svelte.js'
import { redirect } from '@sveltejs/kit'
export async function load({ params, fetch }) {
+1 -1
View File
@@ -1,6 +1,6 @@
import { profile } from '$lib/auth.svelte'
import { LINKED_INSTANCE_URL } from '$lib/instance.js'
import { client, getClient } from '$lib/lemmy.js'
import { client, getClient } from '$lib/lemmy.svelte.js'
import {
type ListCommunitiesResponse,
type ListingType,
+1 -1
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import type { CommunityView, SubscribedType } from 'lemmy-js-client'
import { profile } from '$lib/auth.svelte.js'
import { toast } from 'mono-svelte'
+1 -1
View File
@@ -1,4 +1,4 @@
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
export const load = ({ url }) => {
return { crosspost: Boolean(url.searchParams.get('crosspost')) ?? false }
+1 -1
View File
@@ -9,7 +9,7 @@
Icon,
Inbox,
} from 'svelte-hero-icons'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { goto } from '$app/navigation'
import { page } from '$app/state'
import Pageination from '$lib/components/ui/Pageination.svelte'
+1 -1
View File
@@ -1,6 +1,6 @@
import { profile } from '$lib/auth.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import {
generalizeCommentReply,
generalizePersonMention,
+1 -1
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { notifications, profile } from '$lib/auth.svelte.js'
import {
ArrowUturnLeft,
+1 -1
View File
@@ -1,4 +1,4 @@
import { client } from '$lib/lemmy.js'
import { client } from '$lib/lemmy.svelte.js'
import { awaitIfServer } from '$lib/promise.js'
export async function load({ fetch, url }) {
@@ -8,7 +8,7 @@
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { fly } from 'svelte/transition'
import { backOut, expoOut } from 'svelte/easing'
import { client } from '$lib/lemmy'
import { client } from '$lib/lemmy.svelte'
import { errorMessage } from '$lib/lemmy/error'
import type { PrivateMessageResponse } from 'lemmy-js-client'
import { flip } from 'svelte/animate'
@@ -1,4 +1,4 @@
import { client } from '$lib/lemmy.js'
import { client } from '$lib/lemmy.svelte.js'
import { awaitIfServer } from '$lib/promise.js'
export async function load({ fetch, params }) {
+1 -1
View File
@@ -1,4 +1,4 @@
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
export async function load({ fetch }) {
return (await getClient(undefined, fetch).getFederatedInstances())
+3 -3
View File
@@ -2,7 +2,7 @@
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { site } from '$lib/lemmy'
import { site } from '$lib/lemmy.svelte'
import { t } from '$lib/translations'
import { Button, Modal, Spinner } from 'mono-svelte'
@@ -10,11 +10,11 @@
</script>
<div class="flex flex-row w-full">
{#if $site}
{#if site.data}
<div class="flex flex-col flex-1 gap-4">
<Header pageHeader>{$t('routes.legal.title')}</Header>
<Markdown
source={$site.site_view.local_site.legal_information ??
source={site.data.site_view.local_site.legal_information ??
$t('routes.legal.noLegal')}
/>
</div>
+2 -2
View File
@@ -10,7 +10,7 @@
mayBeIncompatible,
site,
validateInstance,
} from '$lib/lemmy.js'
} from '$lib/lemmy.svelte.js'
import { Button, TextInput } from 'mono-svelte'
import {
Icon,
@@ -98,7 +98,7 @@
<div class="flex flex-col">
{@render children?.()}
<Header>{$t('account.login')}</Header>
{#if $site && mayBeIncompatible(MINIMUM_VERSION, $site.version.replace('v', ''))}
{#if site.data && mayBeIncompatible(MINIMUM_VERSION, site.data.version.replace('v', ''))}
<Note>
{$t('account.versionGate', {
//@ts-ignore
+3 -3
View File
@@ -1,10 +1,10 @@
<script lang="ts">
import { preventDefault } from 'svelte/legacy'
import { site, validateInstance } from '$lib/lemmy.js'
import { site, validateInstance } from '$lib/lemmy.svelte.js'
import { Button, Note, TextInput, toast } from 'mono-svelte'
import { MINIMUM_VERSION } from '$lib/version'
import { mayBeIncompatible } from '$lib/lemmy'
import { mayBeIncompatible } from '$lib/lemmy.svelte'
import { DOMAIN_REGEX_FORMS } from '$lib/util.svelte'
import { profile, profileData, type Profile } from '$lib/auth.svelte'
import { LINKED_INSTANCE_URL } from '$lib/instance'
@@ -54,7 +54,7 @@
<div class="flex flex-col gap-2">
{@render children?.()}
<Header>{$t('account.addGuest')}</Header>
{#if $site && mayBeIncompatible(MINIMUM_VERSION, $site.version.replace('v', ''))}
{#if site.data && mayBeIncompatible(MINIMUM_VERSION, site.data.version.replace('v', ''))}
<Note>
{$t('account.versionGate', {
//@ts-ignore
+1 -1
View File
@@ -7,7 +7,7 @@
LINKED_INSTANCE_URL,
instance as currentInstance,
} from '$lib/instance.js'
import { getClient, validateInstance } from '$lib/lemmy.js'
import { getClient, validateInstance } from '$lib/lemmy.svelte.js'
import { t } from '$lib/translations'
import { Button, TextInput, toast } from 'mono-svelte'
+1 -1
View File
@@ -1,6 +1,6 @@
import { profile } from '$lib/auth.svelte'
import { isAdmin } from '$lib/components/lemmy/moderation/moderation.js'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import {
generalizeCommentReport,
generalizePostReport,
+1 -1
View File
@@ -2,7 +2,7 @@
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte'
import { Material, toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { isCommentReport, isPostReport } from '$lib/lemmy/item.js'
import type {
CommentReportView,
+1 -1
View File
@@ -1,5 +1,5 @@
import { publishedToDate } from '$lib/components/util/date.js'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import type {
AdminPurgeCommentView,
AdminPurgeCommunityView,
@@ -8,7 +8,7 @@
LINKED_INSTANCE_URL,
instance as currentInstance,
} from '$lib/instance.js'
import { getClient, validateInstance } from '$lib/lemmy.js'
import { getClient, validateInstance } from '$lib/lemmy.svelte.js'
import { t } from '$lib/translations'
import { Button, TextInput, toast } from 'mono-svelte'
@@ -1,7 +1,7 @@
<script lang="ts">
import { buildCommentsTree } from '$lib/components/lemmy/comment/comments.svelte.js'
import { isImage } from '$lib/ui/image.js'
import { client, getClient } from '$lib/lemmy.js'
import { client, getClient } from '$lib/lemmy.svelte.js'
import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte'
import { onMount } from 'svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
@@ -1,5 +1,5 @@
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { awaitIfServer } from '$lib/promise.js'
import { SSR_ENABLED, settings } from '$lib/settings.svelte'
import type { GetComments } from 'lemmy-js-client'
@@ -7,7 +7,7 @@
import type { PageData } from './$types.js'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { profile } from '$lib/auth.svelte.js'
import { Check, Icon, Trash, XMark } from 'svelte-hero-icons'
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation'
import { page } from '$app/state'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { client } from '$lib/lemmy.js'
import { client } from '$lib/lemmy.svelte.js'
import { t } from '$lib/translations.js'
import { qr } from '@svelte-put/qr/svg'
import { Button, Material, TextInput, toast } from 'mono-svelte'
@@ -2,7 +2,7 @@
import { preventDefault } from 'svelte/legacy'
import { deleteProfile, profile, setUser } from '$lib/auth.svelte'
import { client } from '$lib/lemmy'
import { client } from '$lib/lemmy.svelte'
import { instance as currentInstance } from '$lib/instance'
import { t } from '$lib/translations'
import { Button, TextInput, toast } from 'mono-svelte'
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation'
import { profileData, setUserID } from '$lib/auth.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { client } from '$lib/lemmy'
import { client } from '$lib/lemmy.svelte'
import { t } from '$lib/translations'
import {
Button,
@@ -1,7 +1,7 @@
<script lang="ts">
import { publishedToDate } from '$lib/components/util/date.js'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { client } from '$lib/lemmy.js'
import { client } from '$lib/lemmy.svelte.js'
import { Checkbox, Material } from 'mono-svelte'
import { Icon, Key } from 'svelte-hero-icons'
@@ -1,4 +1,4 @@
import { client } from '$lib/lemmy.js'
import { client } from '$lib/lemmy.svelte.js'
export async function load({ fetch, parent }) {
const user = await parent()
@@ -12,7 +12,7 @@
removeToast,
toast,
} from 'mono-svelte'
import { getClient, site } from '$lib/lemmy.js'
import { getClient, site } from '$lib/lemmy.svelte.js'
import type { SaveUserSettings } from 'lemmy-js-client'
import { Button, Switch, TextInput } from 'mono-svelte'
import { uploadImage } from '$lib/util.svelte.js'
@@ -129,7 +129,7 @@
<SectionTitle>{$t('form.profile.languages.title')}</SectionTitle>
<p>{$t('form.profile.languages.description')}</p>
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
{#if $site && formData.discussion_languages}
{#if site.data && formData.discussion_languages}
<div class="flex gap-2 flex-wrap flex-row">
<Menu class="gap-px">
{#snippet target()}
@@ -140,7 +140,7 @@
</Badge>
</button>
{/snippet}
{#each $site.all_languages.filter((l) => !formData.discussion_languages?.includes(l.id)) as language, index}
{#each site.data.all_languages.filter((l) => !formData.discussion_languages?.includes(l.id)) as language, index}
<MenuButton
class="min-h-[16px] py-0"
onclick={() => {
@@ -152,7 +152,7 @@
{/each}
</Menu>
{#each formData.discussion_languages as languageId, index}
{@const language = $site.all_languages.find(
{@const language = site.data.all_languages.find(
(l) => l.id == languageId,
)}
<button
+2 -2
View File
@@ -5,7 +5,7 @@
import MultiSelect from '$lib/components/input/Switch.svelte'
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
import { site } from '$lib/lemmy'
import { site } from '$lib/lemmy.svelte'
import { t } from '$lib/translations'
import { feature } from '$lib/version'
import { Button, Menu, MenuButton } from 'mono-svelte'
@@ -62,7 +62,7 @@
},
]}
/>
{#if feature('mediaAndVotes', $site?.version)}
{#if feature('mediaAndVotes', site.data?.version)}
<Menu class="flex-1" placement="bottom-end">
{#snippet target()}
<Button
+1 -1
View File
@@ -1,5 +1,5 @@
import { profile } from '$lib/auth.svelte'
import { client, getClient } from '$lib/lemmy.js'
import { client, getClient } from '$lib/lemmy.svelte.js'
import { getItemPublished } from '$lib/lemmy/item.js'
import type { SortType } from 'lemmy-js-client'
import { get } from 'svelte/store'
+1 -1
View File
@@ -1,5 +1,5 @@
import { profile } from '$lib/auth.svelte'
import { client } from '$lib/lemmy.js'
import { client } from '$lib/lemmy.svelte.js'
export async function load({ fetch, url }) {
const { jwt } = profile.data
+1 -1
View File
@@ -3,7 +3,7 @@
import { publishedToDate } from '$lib/components/util/date'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { instance } from '$lib/instance'
import { client } from '$lib/lemmy'
import { client } from '$lib/lemmy.svelte'
import { t } from '$lib/translations'
import { instanceToURL } from '$lib/util.svelte'
import type { LocalImage } from 'lemmy-js-client'
+1 -1
View File
@@ -1,4 +1,4 @@
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { getItemPublished } from '$lib/lemmy/item.js'
import type { SortType } from 'lemmy-js-client'
+1 -1
View File
@@ -1,4 +1,4 @@
import { client } from '$lib/lemmy.js'
import { client } from '$lib/lemmy.svelte.js'
import { postFeed } from '$lib/lemmy/postfeed.js'
import { error } from '@sveltejs/kit'
+1 -1
View File
@@ -1,5 +1,5 @@
import { profile } from '$lib/auth.svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import type { CommentView, ListingType, PostView } from 'lemmy-js-client'
function getSavedItemPublished(item: PostView | CommentView) {
+1 -1
View File
@@ -1,5 +1,5 @@
import { profile } from '$lib/auth.svelte'
import { client, getClient } from '$lib/lemmy.js'
import { client, getClient } from '$lib/lemmy.svelte.js'
import { getItemPublished } from '$lib/lemmy/item.js'
import type {
CommentView,
+1 -1
View File
@@ -19,7 +19,7 @@
import { goto } from '$app/navigation'
import { Badge, Material, Spinner, toast } from 'mono-svelte'
import { DEFAULT_INSTANCE_URL } from '$lib/instance.js'
import { validateInstance } from '$lib/lemmy.js'
import { validateInstance } from '$lib/lemmy.svelte.js'
import { Button, TextInput } from 'mono-svelte'
import { onMount } from 'svelte'
import Avatar from '$lib/components/ui/Avatar.svelte'
+1 -1
View File
@@ -9,7 +9,7 @@
import Avatar from '$lib/components/ui/Avatar.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import { Checkbox, Material, Spinner, toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import type { GetCaptchaResponse } from 'lemmy-js-client'
import { Button, TextInput } from 'mono-svelte'
import {
+1 -1
View File
@@ -1,4 +1,4 @@
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
export async function load({ params, fetch }) {
const site = await getClient(params.instance, fetch).getSite()
+1 -1
View File
@@ -20,7 +20,7 @@
import { page } from '$app/state'
import { goto } from '$app/navigation'
import { isCommentView } from '$lib/lemmy/item.js'
import { client, getClient } from '$lib/lemmy.js'
import { client, getClient } from '$lib/lemmy.svelte.js'
import { isBlocked } from '$lib/lemmy/user.js'
import { Menu, MenuButton, removeToast, toast } from 'mono-svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
+1 -1
View File
@@ -1,4 +1,4 @@
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { getItemPublished } from '$lib/lemmy/item.js'
import type { SortType } from 'lemmy-js-client'
+1 -1
View File
@@ -1,4 +1,4 @@
import { getClient } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.svelte.js'
import { error } from '@sveltejs/kit'
export async function load({ fetch, params }) {