impr: remove dead code

This commit is contained in:
James Xylight committed 2025-07-30 15:11:02 -07:00
1 parent d27587673d
commit e987628cc1
7 files changed
+13 -108

No files matched your search

+1 -20
View File
@@ -1,7 +1,6 @@
<script lang="ts">
import { goto } from '$app/navigation'
import { profile } from '$lib/auth.svelte'
import { mediaType, postLink } from '$lib/components/lemmy/post/helpers.js'
import { mediaType } from '$lib/components/lemmy/post/helpers.js'
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
import PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
@@ -28,15 +27,6 @@
return rule
}
function onClick(e: Event) {
const event = e as Event
const parent = document.getElementById(post.post.id.toString())
if (event.target == parent) {
goto(postLink(post.post))
}
}
interface Props {
post: PostView
actions?: boolean
@@ -86,8 +76,6 @@
This is the sole component for displaying posts.
It adapts to all kinds of form factors for different contexts, such as feeds, full post view, and crosspost list.
-->
<!-- svelte-ignore a11y_no_static_element_interactions -->
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
<div
class={[
'post relative max-w-full min-w-0 w-full cursor-pointer outline-hidden group',
@@ -97,13 +85,6 @@
clazz,
]}
id={post.post.id.toString()}
onclick={e => {
onClick(e)
}}
onkeydown={e => {
if (e.key == 'Enter') onClick(e)
}}
tabindex="0"
{style}
>
<PostMeta
@@ -186,7 +186,7 @@
style={row < 7 ? `--anim-delay: ${row * 50}ms` : ''}
class={[
'relative post-container px-3 sm:px-6',
row < 7 && 'pop-in opacity-0',
row < 9 && 'pop-in opacity-0',
]}
>
<Post
@@ -219,12 +219,7 @@
<Icon src={ExclamationTriangle} size="24" solid></Icon>
</div>
<pre class="py-0.5">{error}</pre>
<Button
color="primary"
{loading}
disabled={loading}
onclick={() => loadMore()}
>
<Button color="primary" {loading} onclick={loadMore}>
{$t('message.retry')}
</Button>
</div>
@@ -256,14 +251,7 @@
</EndPlaceholder>
</div>
{/if}
<InfiniteScroll
window
threshold={600}
on:loadMore={() => {
console.log('loadMore triggered')
loadMore()
}}
/>
<InfiniteScroll window threshold={600} on:loadMore={loadMore} />
{/if}
{@render children?.()}
</ul>