fix: hang when switching profile on post page
This commit is contained in:
1 parent
c268dfb29e
commit
5a892648fb
3 files changed
+17
-5
No files matched your search
@@ -165,7 +165,7 @@
|
|||||||
{edit ? 'Edit' : 'Create'} Post
|
{edit ? 'Edit' : 'Create'} Post
|
||||||
</h1>
|
</h1>
|
||||||
</slot>
|
</slot>
|
||||||
{#if !edit}
|
{#if !edit && data}
|
||||||
<div>
|
<div>
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<span class="block my-1 font-bold text-sm">
|
<span class="block my-1 font-bold text-sm">
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
switching = false
|
switching = false
|
||||||
}}
|
}}
|
||||||
class="w-full font-normal {$profile?.id == prof.id
|
class="w-full font-normal {$profile?.id == prof.id
|
||||||
? 'bg-slate-100 dark:bg-zinc-900'
|
? '!bg-slate-100 dark:!bg-zinc-900'
|
||||||
: ''} {expanded ? '' : '!p-1.5'}"
|
: ''} {expanded ? '' : '!p-1.5'}"
|
||||||
>
|
>
|
||||||
<ProfileAvatar
|
<ProfileAvatar
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
class:hidden={!expanded}
|
class:hidden={!expanded}
|
||||||
class="flex flex-col gap-0 {$profile?.id == prof.id ? 'font-bold' : ''}"
|
class="flex flex-col gap-0 {$profile?.id == prof.id ? 'font-semibold' : ''}"
|
||||||
>
|
>
|
||||||
{prof.username ?? prof.user?.local_user_view.person.name}
|
{prof.username ?? prof.user?.local_user_view.person.name}
|
||||||
<span class="text-slate-500 dark:text-zinc-400 font-normal text-xs">
|
<span class="text-slate-500 dark:text-zinc-400 font-normal text-xs">
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
import { onDestroy, onMount } from 'svelte'
|
import { onDestroy, onMount } from 'svelte'
|
||||||
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
|
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
|
||||||
|
|
||||||
export let data
|
export let data = {
|
||||||
|
crosspost: false,
|
||||||
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if (!$profile?.jwt) {
|
if (!$profile?.jwt) {
|
||||||
@@ -30,7 +32,17 @@
|
|||||||
|
|
||||||
<div class="w-full max-w-5xl mx-auto h-full">
|
<div class="w-full max-w-5xl mx-auto h-full">
|
||||||
<PostForm
|
<PostForm
|
||||||
data={data.crosspost ? draft : undefined}
|
data={data.crosspost == true
|
||||||
|
? draft
|
||||||
|
: {
|
||||||
|
body: '',
|
||||||
|
community: null,
|
||||||
|
image: null,
|
||||||
|
loading: false,
|
||||||
|
nsfw: false,
|
||||||
|
title: '',
|
||||||
|
url: undefined,
|
||||||
|
}}
|
||||||
passedCommunity={community}
|
passedCommunity={community}
|
||||||
on:submit={(e) => goto(`/post/${e.detail.post.id}`)}
|
on:submit={(e) => goto(`/post/${e.detail.post.id}`)}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in new issue
Block a user