feat: add v0.19.0 support

This commit is contained in:
Xyphyn committed 2023-09-28 17:09:09 -07:00
1 parent b3b8a10e44
commit 119ab53946
62 files changed
+188 -157

No files matched your search

@@ -63,7 +63,6 @@
communitySearch = passedCommunity.name
} else {
const list = await getClient().listCommunities({
auth: $profile?.jwt,
type_: 'All',
sort: 'Active',
limit: 40,
@@ -107,7 +106,6 @@
}
const post = await getClient().editPost({
auth: $profile.jwt,
name: data.title,
body: data.body,
url: data.url || undefined,
@@ -121,10 +119,11 @@
dispatcher('submit', post.post_view)
} else {
let image = data.image ? await uploadImage(data.image[0], $profile.instance, $profile.jwt) : undefined
let image = data.image
? await uploadImage(data.image[0], $profile.instance, $profile.jwt)
: undefined
data.url = image || data.url || undefined
const post = await getClient().createPost({
auth: $profile.jwt,
community_id: data.community!,
name: data.title,
body: data.body,
+2 -5
View File
@@ -1,9 +1,6 @@
import { getInstance } from '$lib/lemmy.js'
import type { CommentView, PersonView, Post, PostView } from 'lemmy-js-client'
export const isMutable = (post: PostView, me: PersonView) =>
(me.person.admin && post.post.local) || me.person.id == post.creator.id
export const isCommentMutable = (comment: CommentView, me: PersonView) =>
me.person.id == comment.creator.id
@@ -13,8 +10,8 @@ export const bestImageURL = (
width: number = 1024
) => {
if (width > 1024) {
if (post.url) return `${post.url}?format=webp`
else if (post.thumbnail_url) return `${post.thumbnail_url}?format=webp`
if (post.url) return `${post.url}?format=webp`
else if (post.thumbnail_url) return `${post.thumbnail_url}?format=webp`
}
if (compact && post.thumbnail_url)