feat: use state based auth instead of store based (#488)
* misc: switch to state for auth * fix: class based auth not working
This commit is contained in:
1 parent
8c6ff77fac
commit
5651ad475d
83 files changed
+395
-469
No files matched your search
@@ -1,8 +1,10 @@
|
||||
import { client, getInstance } from '$lib/lemmy.js'
|
||||
import { profile } from '$lib/auth.svelte'
|
||||
import { client } from '$lib/lemmy.js'
|
||||
import type { View } from '$lib/settings.svelte'
|
||||
import { isImage, isVideo } from '$lib/ui/image'
|
||||
import { canParseUrl, findClosestNumber } from '$lib/util.svelte'
|
||||
import type { CommentView, PersonView, Post, PostView } from 'lemmy-js-client'
|
||||
import { get } from 'svelte/store'
|
||||
|
||||
export const isCommentMutable = (comment: CommentView, me: PersonView) =>
|
||||
me.person.id == comment.creator.id
|
||||
@@ -57,7 +59,8 @@ export const isYoutubeLink = (url?: string): RegExpMatchArray | null => {
|
||||
return url?.match?.(YOUTUBE_REGEX)
|
||||
}
|
||||
|
||||
export const postLink = (post: Post) => `/post/${getInstance()}/${post.id}`
|
||||
export const postLink = (post: Post) =>
|
||||
`/post/${profile.data.instance}/${post.id}`
|
||||
|
||||
export type MediaType = 'video' | 'image' | 'iframe' | 'embed' | 'none'
|
||||
export type IframeType = 'youtube' | 'video' | 'none'
|
||||
|
||||
Reference in new issue
Block a user