fix: resolve all typescript errors in sv check (#715)
This commit is contained in:
1 parent
2a5fb886ae
commit
7bddf16559
38 files changed
+233
-287
No files matched your search
@@ -57,40 +57,29 @@
|
||||
>
|
||||
{#if !children}
|
||||
{#if community.community.deleted}
|
||||
<Icon
|
||||
src={Trash}
|
||||
class="text-red-500 inline"
|
||||
micro
|
||||
size="14"
|
||||
title={$t('post.badges.deleted')}
|
||||
/>
|
||||
<span title={$t('post.badges.deleted')}>
|
||||
<Icon src={Trash} class="text-red-500 inline" micro size="14" />
|
||||
</span>
|
||||
{/if}
|
||||
{#if community.community.nsfw}
|
||||
<Icon
|
||||
src={ExclamationTriangle}
|
||||
class="text-red-500 inline"
|
||||
micro
|
||||
size="14"
|
||||
title={$t('post.badges.nsfw')}
|
||||
/>
|
||||
<span title={$t('post.badges.nsfw')}>
|
||||
<Icon
|
||||
src={ExclamationTriangle}
|
||||
class="text-red-500 inline"
|
||||
micro
|
||||
size="14"
|
||||
/>
|
||||
</span>
|
||||
{/if}
|
||||
{#if community.banned_from_community}
|
||||
<Icon
|
||||
src={NoSymbol}
|
||||
class="text-red-500 inline"
|
||||
micro
|
||||
size="14"
|
||||
title={$t('comment.banned')}
|
||||
/>
|
||||
<span title={$t('comment.banned')}>
|
||||
<Icon src={NoSymbol} class="text-red-500 inline" micro size="14" />
|
||||
</span>
|
||||
{/if}
|
||||
{#if community.community.visibility == 'LocalOnly'}
|
||||
<Icon
|
||||
src={MapPin}
|
||||
class="text-green-500 inline"
|
||||
micro
|
||||
size="14"
|
||||
title={$t('routes.admin.config.listingType.local')}
|
||||
/>
|
||||
<span title={$t('routes.admin.config.listingType.local')}>
|
||||
<Icon src={MapPin} class="text-green-500 inline" micro size="14" />
|
||||
</span>
|
||||
{/if}
|
||||
<Button
|
||||
rounding="xl"
|
||||
|
||||
@@ -89,40 +89,29 @@
|
||||
/>
|
||||
</div>
|
||||
{#if community.community.deleted}
|
||||
<Icon
|
||||
src={Trash}
|
||||
class="text-red-500 inline"
|
||||
micro
|
||||
size="14"
|
||||
title={$t('post.badges.deleted')}
|
||||
/>
|
||||
<span title={$t('post.badges.deleted')}>
|
||||
<Icon src={Trash} class="text-red-500 inline" micro size="14" />
|
||||
</span>
|
||||
{/if}
|
||||
{#if community.community.nsfw}
|
||||
<Icon
|
||||
src={ExclamationTriangle}
|
||||
class="text-red-500 inline"
|
||||
micro
|
||||
size="14"
|
||||
title={$t('post.badges.nsfw')}
|
||||
/>
|
||||
<span title={$t('post.badges.nsfw')}>
|
||||
<Icon
|
||||
src={ExclamationTriangle}
|
||||
class="text-red-500 inline"
|
||||
micro
|
||||
size="14"
|
||||
/>
|
||||
</span>
|
||||
{/if}
|
||||
{#if community.banned_from_community}
|
||||
<Icon
|
||||
src={NoSymbol}
|
||||
class="text-red-500 inline"
|
||||
micro
|
||||
size="14"
|
||||
title={$t('comment.banned')}
|
||||
/>
|
||||
<span title={$t('comment.banned')}>
|
||||
<Icon src={NoSymbol} class="text-red-500 inline" micro size="14" />
|
||||
</span>
|
||||
{/if}
|
||||
{#if community.community.visibility == 'LocalOnly'}
|
||||
<Icon
|
||||
src={MapPin}
|
||||
class="text-green-500 inline"
|
||||
micro
|
||||
size="14"
|
||||
title={$t('routes.admin.config.listingType.local')}
|
||||
/>
|
||||
<span title={$t('routes.admin.config.listingType.local')}>
|
||||
<Icon src={MapPin} class="text-green-500 inline" micro size="14" />
|
||||
</span>
|
||||
{/if}
|
||||
<div class="flex gap-2 items-center justify-end w-full z-30 mt-auto">
|
||||
<Button
|
||||
|
||||
@@ -67,13 +67,14 @@
|
||||
{/if}
|
||||
{#if badges}
|
||||
{#if badges.nsfw}
|
||||
<Icon
|
||||
src={ExclamationTriangle}
|
||||
size="14"
|
||||
micro
|
||||
title={$t('post.badges.nsfw')}
|
||||
class="text-red-600 dark:text-red-400"
|
||||
/>
|
||||
<span title={$t('post.badges.nsfw')}>
|
||||
<Icon
|
||||
src={ExclamationTriangle}
|
||||
size="14"
|
||||
micro
|
||||
class="text-red-600 dark:text-red-400"
|
||||
/>
|
||||
</span>
|
||||
{/if}
|
||||
{/if}
|
||||
</a>
|
||||
|
||||
@@ -5,6 +5,7 @@ import type {
|
||||
Community,
|
||||
CommunityView,
|
||||
PersonView,
|
||||
Post,
|
||||
PostReportView,
|
||||
PostView,
|
||||
PrivateMessage,
|
||||
@@ -13,7 +14,6 @@ import type {
|
||||
} from '$lib/api/types'
|
||||
import { profile } from '$lib/app/auth'
|
||||
import { writable } from 'svelte/store'
|
||||
import type { Post } from '../post'
|
||||
|
||||
export type Result =
|
||||
| PostView
|
||||
|
||||
@@ -199,7 +199,6 @@
|
||||
comment_view: item,
|
||||
depth: 1,
|
||||
}}
|
||||
postId={item.post.id}
|
||||
actions={false}
|
||||
/>
|
||||
{:else if isPostView(item)}
|
||||
|
||||
@@ -118,7 +118,7 @@ export class PostFormState {
|
||||
).post_view
|
||||
}
|
||||
|
||||
if (api instanceof PiefedClient) {
|
||||
if (api instanceof PiefedClient && api.assignFlair) {
|
||||
const flairRes = await api.assignFlair({
|
||||
flair_id_list: this.flairList.map((i) => i.id),
|
||||
post_id: res.post.id,
|
||||
|
||||
@@ -103,6 +103,7 @@
|
||||
opened?: boolean
|
||||
autoplay?: boolean
|
||||
title?: string
|
||||
class?: string
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -112,6 +113,7 @@
|
||||
title,
|
||||
opened = $bindable(!settings.embeds.clickToView),
|
||||
autoplay = settings.embeds.clickToView,
|
||||
class: clazz = '',
|
||||
}: Props = $props()
|
||||
|
||||
let data = $derived(typeData(type))
|
||||
@@ -122,7 +124,7 @@
|
||||
@component
|
||||
Displays a video file or embedded video iframe.
|
||||
-->
|
||||
<div class="iframe-container">
|
||||
<div class={['iframe-container', clazz]}>
|
||||
{#if opened}
|
||||
{#if type == 'video'}
|
||||
<video {autoplay} controls>
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
>
|
||||
{#if post.alt_text}
|
||||
<Button
|
||||
onclick={(e) => {
|
||||
onclick={(e: MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
modal({
|
||||
title: 'Alt',
|
||||
|
||||
@@ -60,16 +60,18 @@
|
||||
|
||||
canVote = false
|
||||
|
||||
if (typeof id !== 'number') {
|
||||
await api.voteOnPoll({
|
||||
post_id: post.id,
|
||||
choice_id: id,
|
||||
})
|
||||
} else {
|
||||
await api.voteOnPoll({
|
||||
post_id: post.id,
|
||||
choice_id: [id],
|
||||
})
|
||||
if (api.voteOnPoll) {
|
||||
if (typeof id !== 'number') {
|
||||
await api.voteOnPoll({
|
||||
post_id: post.id,
|
||||
choice_id: id,
|
||||
})
|
||||
} else {
|
||||
await api.voteOnPoll({
|
||||
post_id: post.id,
|
||||
choice_id: [id],
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
let switching: boolean = $state(false)
|
||||
interface Props {
|
||||
prof: ProfileInfo
|
||||
index: number
|
||||
guest?: boolean
|
||||
}
|
||||
|
||||
let { prof, index, guest = false }: Props = $props()
|
||||
let { prof, guest = false }: Props = $props()
|
||||
</script>
|
||||
|
||||
<SidebarButton
|
||||
@@ -39,12 +38,7 @@
|
||||
class="w-full font-normal"
|
||||
>
|
||||
{#snippet customIcon()}
|
||||
<ProfileAvatar
|
||||
profile={prof}
|
||||
{index}
|
||||
{guest}
|
||||
selected={profile.current?.id == prof.id}
|
||||
/>
|
||||
<ProfileAvatar profile={prof} selected={profile.current?.id == prof.id} />
|
||||
{/snippet}
|
||||
<span
|
||||
class="inline-flex flex-col gap-0 {profile.current?.id == prof.id
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
showWhenEmpty?: boolean
|
||||
hideOwnUser?: boolean
|
||||
placeholder?: string
|
||||
onselect?: (e: Person) => void
|
||||
label?: string
|
||||
onselect?: (e?: Person) => void
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -24,6 +25,7 @@
|
||||
listing_type = 'Subscribed',
|
||||
showWhenEmpty = false,
|
||||
hideOwnUser = false,
|
||||
label,
|
||||
...rest
|
||||
}: Props = $props()
|
||||
|
||||
@@ -50,6 +52,7 @@
|
||||
}}
|
||||
extractName={(c) => `${c.name}@${new URL(c.actor_id).hostname}`}
|
||||
bind:query={q}
|
||||
{label}
|
||||
{...rest}
|
||||
>
|
||||
{#snippet noresults()}
|
||||
|
||||
Reference in new issue
Block a user