feat: add crossposting
This commit is contained in:
1 parent
1168338458
commit
e02abec9d0
5 files changed
+53
-13
No files matched your search
@@ -6,6 +6,8 @@
|
||||
import { onMount } from 'svelte'
|
||||
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
|
||||
|
||||
export let data
|
||||
|
||||
onMount(() => {
|
||||
if (!$profile?.jwt) {
|
||||
goto('/login')
|
||||
@@ -17,6 +19,8 @@
|
||||
| undefined
|
||||
|
||||
setSessionStorage('lastSeenCommunity', undefined)
|
||||
|
||||
let draft = getSessionStorage('postDraft') as any
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@@ -25,6 +29,7 @@
|
||||
|
||||
<div class="w-full max-w-5xl mx-auto h-full">
|
||||
<PostForm
|
||||
data={data.crosspost ? draft : undefined}
|
||||
passedCommunity={community}
|
||||
on:submit={(e) => goto(`/post/${e.detail.post.id}`)}
|
||||
>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export const load = ({ url }) => ({
|
||||
crosspost: Boolean(url.searchParams.get('crosspost')) ?? false,
|
||||
})
|
||||
Reference in new issue
Block a user