prettier: format project
This commit is contained in:
94 files changed
+261
-252
No files matched your search
@@ -15,7 +15,7 @@
|
||||
import PostBody from './PostBody.svelte'
|
||||
|
||||
function getTagRule(tags: Tag[]): 'blur-sm' | 'hide' | undefined {
|
||||
const tagContent = tags.map(t => t.content.toLowerCase())
|
||||
const tagContent = tags.map((t) => t.content.toLowerCase())
|
||||
|
||||
let rule: 'blur-sm' | 'hide' | undefined
|
||||
if (settings.nsfwBlur && (post.post.nsfw || post.community.nsfw))
|
||||
@@ -94,7 +94,7 @@
|
||||
published={publishedToDate(post.post.published)}
|
||||
{badges}
|
||||
subscribed={profile.current?.user?.follows
|
||||
.map(c => c.community.id)
|
||||
.map((c) => c.community.id)
|
||||
.includes(post.community.id)
|
||||
? 'Subscribed'
|
||||
: 'NotSubscribed'}
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
vote = newVote
|
||||
|
||||
voteItem(post, newVote)
|
||||
.then(res => ({ upvotes, downvotes, score } = res))
|
||||
.catch(e => {
|
||||
.then((res) => ({ upvotes, downvotes, score } = res))
|
||||
.catch((e) => {
|
||||
toast({ content: errorMessage(e), type: 'error' })
|
||||
})
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
const abortLoad = new AbortController()
|
||||
let seenIds = new SvelteSet<number>(
|
||||
feedData.posts.posts.map(post => post.post.id),
|
||||
feedData.posts.posts.map((post) => post.post.id),
|
||||
)
|
||||
|
||||
async function loadMore() {
|
||||
@@ -80,7 +80,7 @@
|
||||
sort: feedData.sort,
|
||||
type_: feedData.type_,
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
throw new Error(e)
|
||||
})
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
|
||||
feedData.cursor.next = newPosts.next_page
|
||||
feedData.posts.posts.push(
|
||||
...newPosts.posts.filter(post => {
|
||||
...newPosts.posts.filter((post) => {
|
||||
if (seenIds.has(post.post.id)) return false
|
||||
seenIds.add(post.post.id)
|
||||
return true
|
||||
@@ -107,7 +107,7 @@
|
||||
}
|
||||
|
||||
const callback: IntersectionObserverCallback = (entries, observer) => {
|
||||
entries.forEach(entry => {
|
||||
entries.forEach((entry) => {
|
||||
if (!entry.isIntersecting) return
|
||||
|
||||
const element = entry.target as HTMLElement
|
||||
@@ -147,7 +147,7 @@
|
||||
const feed = document.getElementById('feed')
|
||||
if (!feed) return
|
||||
|
||||
new MutationObserver(mutations => {
|
||||
new MutationObserver((mutations) => {
|
||||
mutations.forEach(({ addedNodes, removedNodes }) => {
|
||||
addedNodes.forEach(observePost)
|
||||
removedNodes.forEach(unobservePost)
|
||||
|
||||
@@ -18,7 +18,7 @@ export const combineCrossposts = (
|
||||
const results: (PostViewWithCrossposts | PostViewWithoutCrossposts)[] = []
|
||||
const seenUrls = new SvelteSet<string>()
|
||||
|
||||
posts?.forEach(post => {
|
||||
posts?.forEach((post) => {
|
||||
if (
|
||||
!post ||
|
||||
(settings.hidePosts.deleted && post.post.deleted) ||
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
limit: 40,
|
||||
})
|
||||
|
||||
communities = list.communities.map(c => c.community)
|
||||
communities = list.communities.map((c) => c.community)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -209,7 +209,7 @@
|
||||
if (res.metadata.description)
|
||||
data.body = res.metadata.description
|
||||
.split('\n')
|
||||
.map(l => `> ${l}`)
|
||||
.map((l) => `> ${l}`)
|
||||
.join('\n')
|
||||
|
||||
toast({
|
||||
@@ -254,7 +254,7 @@
|
||||
{#await import('$lib/components/form/ImageInputModal.svelte') then { default: UploadModal }}
|
||||
<UploadModal
|
||||
bind:open={uploadingImage}
|
||||
bind:imageUrl={() => '', v => (data.url = v)}
|
||||
bind:imageUrl={() => '', (v) => (data.url = v)}
|
||||
/>
|
||||
{/await}
|
||||
{/if}
|
||||
@@ -262,7 +262,7 @@
|
||||
{#if addAltText}
|
||||
<Modal title={$t('form.post.altText')} bind:open={addAltText}>
|
||||
<form
|
||||
onsubmit={e => {
|
||||
onsubmit={(e) => {
|
||||
e.preventDefault()
|
||||
addAltText = !addAltText
|
||||
}}
|
||||
@@ -277,7 +277,7 @@
|
||||
{/if}
|
||||
|
||||
<form
|
||||
onsubmit={e => {
|
||||
onsubmit={(e) => {
|
||||
e.preventDefault()
|
||||
submit()
|
||||
}}
|
||||
@@ -298,7 +298,7 @@
|
||||
listing_type="All"
|
||||
label={$t('form.post.community')}
|
||||
required
|
||||
onselect={e => {
|
||||
onselect={(e) => {
|
||||
const c = e
|
||||
if (!c) {
|
||||
data.community = null
|
||||
|
||||
@@ -88,11 +88,11 @@
|
||||
class="absolute bottom-0 left-0 right-0 flex justify-between items-center
|
||||
rounded-full ml-auto w-max m-2 p-0 gap-1
|
||||
*:bg-white *:border *:border-slate-200 dark:*:border-zinc-800 dark:*:bg-zinc-900"
|
||||
onclick={e => e.stopPropagation()}
|
||||
onclick={(e) => e.stopPropagation()}
|
||||
>
|
||||
{#if post.alt_text}
|
||||
<Button
|
||||
onclick={e => {
|
||||
onclick={(e) => {
|
||||
e.stopPropagation()
|
||||
modal({
|
||||
title: 'Alt',
|
||||
|
||||
Reference in new issue
Block a user