auth: rename profile.data -> profile.current

This commit is contained in:
James Xylight committed 2025-07-12 10:26:45 -07:00
1 parent 1edad4ac60
commit 36a9631707
76 files changed
+233 -224

No files matched your search

+20 -19
View File
@@ -92,27 +92,27 @@ export const profileData = $state<ProfileData>(
) )
class CurrentProfile { class CurrentProfile {
#data = $derived( #current = $derived(
profileData.profiles.find(i => i.id == profileData.profile) ?? profileData.profiles.find(i => i.id == profileData.profile) ??
getDefaultProfile(), getDefaultProfile(),
) )
get data() { get current() {
return this.#data return this.#current
} }
set data(value) { set current(value) {
if (!value) return if (!value) return
const index = profileData.profiles.findIndex(i => i.id == value?.id) const index = profileData.profiles.findIndex(i => i.id == value?.id)
profileData.profiles[index] = value profileData.profiles[index] = value
} }
async fetchUserData() { async fetchUserData() {
const startId = this.#data.id const startId = this.#current.id
if (this.#data.jwt) { if (this.#current.jwt) {
site.data = undefined site.data = undefined
notifications.set({ applications: 0, inbox: 0, reports: 0 }) notifications.set({ applications: 0, inbox: 0, reports: 0 })
const res = await userFromJwt(this.#data.jwt, this.#data.instance) const res = await userFromJwt(this.#current.jwt, this.#current.instance)
if (!res?.user) if (!res?.user)
toast({ toast({
content: content:
@@ -121,21 +121,21 @@ class CurrentProfile {
}) })
// TODO update authentication handling to not be this dynamic // TODO update authentication handling to not be this dynamic
if (this.#data.id != startId) { if (this.#current.id != startId) {
console.error('profile was switched too fast, ID mismatch') console.error('profile was switched too fast, ID mismatch')
return return
} }
site.data = res?.site site.data = res?.site
this.#data.user = res?.user this.#current.user = res?.user
if (profile.data.user) { if (profile.current.user) {
this.#data.avatar = res?.user?.local_user_view.person.avatar this.#current.avatar = res?.user?.local_user_view.person.avatar
this.#data.username = res?.user?.local_user_view.person.name this.#current.username = res?.user?.local_user_view.person.name
} }
} else { } else {
if (browser) { if (browser) {
site.data = undefined site.data = undefined
client({ instanceURL: this.#data.instance }) client({ instanceURL: this.#current.instance })
.getSite() .getSite()
.then(res => (site.data = res)) .then(res => (site.data = res))
} }
@@ -174,7 +174,7 @@ $effect.root(() => {
}) })
$effect(() => { $effect(() => {
if (profile.data.id || profileData) if (profile.current.id || profileData)
profile.fetchUserData().then(() => { profile.fetchUserData().then(() => {
checkInbox() checkInbox()
}) })
@@ -358,7 +358,7 @@ async function getNotificationCount(jwt: string, mod: boolean, admin: boolean) {
} }
async function checkInbox() { async function checkInbox() {
const { user, jwt } = profile.data const { user, jwt } = profile.current
if (!jwt || !user) return if (!jwt || !user) return
const notifs = await getNotificationCount( const notifs = await getNotificationCount(
@@ -380,10 +380,11 @@ async function init() {
// hacky way to check donation status // hacky way to check donation status
setTimeout(() => { setTimeout(() => {
if ( if (
profile.data.user?.local_user_view.local_user.last_donation_notification profile.current.user?.local_user_view.local_user
.last_donation_notification
) { ) {
const donationDate = publishedToDate( const donationDate = publishedToDate(
profile.data.user?.local_user_view.local_user profile.current.user?.local_user_view.local_user
.last_donation_notification, .last_donation_notification,
) )
if (Date.now() - donationDate.getTime() > 365 * 24 * 60 * 60 * 1000) { if (Date.now() - donationDate.getTime() > 365 * 24 * 60 * 60 * 1000) {
@@ -395,11 +396,11 @@ async function init() {
// lemmy js client donation dialog is broken // lemmy js client donation dialog is broken
fetch( fetch(
`${instanceToURL(profile.data.instance)}/api/v3/user/donation_dialog_shown`, `${instanceToURL(profile.current.instance)}/api/v3/user/donation_dialog_shown`,
{ {
method: 'POST', method: 'POST',
headers: { headers: {
authorization: `Bearer ${profile.data.jwt}`, authorization: `Bearer ${profile.current.jwt}`,
}, },
}, },
) )
+1 -1
View File
@@ -14,7 +14,7 @@
let loading = $state(false) let loading = $state(false)
async function deleteImage(image: LocalImage) { async function deleteImage(image: LocalImage) {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
try { try {
loading = true loading = true
@@ -50,7 +50,7 @@
let editingLoad = $state(false) let editingLoad = $state(false)
async function save(type: 'reply' | 'edit') { async function save(type: 'reply' | 'edit') {
if (!profile.data?.jwt || newComment.length <= 0) return if (!profile.current?.jwt || newComment.length <= 0) return
editingLoad = true editingLoad = true
@@ -60,7 +60,7 @@
<Icon src={ChatBubbleOvalLeft} size="14" micro /> <Icon src={ChatBubbleOvalLeft} size="14" micro />
<span class="text-xs">{$t('comment.reply')}</span> <span class="text-xs">{$t('comment.reply')}</span>
</Button> </Button>
{#if profile.data?.user && (amMod(profile.data?.user, comment.community) || isAdmin(profile.data.user))} {#if profile.current?.user && (amMod(profile.current?.user, comment.community) || isAdmin(profile.current.user))}
<CommentModerationMenu bind:item={comment} /> <CommentModerationMenu bind:item={comment} />
{/if} {/if}
<Menu placement="bottom"> <Menu placement="bottom">
@@ -90,8 +90,8 @@
<Icon src={Square2Stack} mini size="16" /> <Icon src={Square2Stack} mini size="16" />
<div>{$t('post.actions.more.share')}</div> <div>{$t('post.actions.more.share')}</div>
</MenuButton> </MenuButton>
{#if profile.data?.jwt} {#if profile.current?.jwt}
{#if comment.creator.id == profile.data.user?.local_user_view.person.id} {#if comment.creator.id == profile.current.user?.local_user_view.person.id}
<MenuButton onclick={() => onedit?.(comment)}> <MenuButton onclick={() => onedit?.(comment)}>
<Icon src={PencilSquare} mini size="16" /> <Icon src={PencilSquare} mini size="16" />
<span>{$t('post.actions.more.edit')}</span> <span>{$t('post.actions.more.edit')}</span>
@@ -99,7 +99,7 @@
{/if} {/if}
<MenuButton <MenuButton
onclick={async () => { onclick={async () => {
if (profile.data?.jwt) if (profile.current?.jwt)
comment.saved = await save(comment, !comment.saved) comment.saved = await save(comment, !comment.saved)
}} }}
> >
@@ -108,11 +108,11 @@
{comment.saved ? $t('post.actions.unsave') : $t('post.actions.save')} {comment.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
</span> </span>
</MenuButton> </MenuButton>
{#if profile.data?.user && profile.data.jwt && profile.data.user.local_user_view.person.id == comment.creator.id} {#if profile.current?.user && profile.current.jwt && profile.current.user.local_user_view.person.id == comment.creator.id}
<MenuButton <MenuButton
color="danger-subtle" color="danger-subtle"
onclick={async () => { onclick={async () => {
if (profile.data?.jwt) if (profile.current?.jwt)
comment.comment.deleted = await deleteItem( comment.comment.deleted = await deleteItem(
comment, comment,
!comment.comment.deleted, !comment.comment.deleted,
@@ -127,7 +127,7 @@
</span> </span>
</MenuButton> </MenuButton>
{/if} {/if}
{#if profile.data.jwt && profile.data.user?.local_user_view.person.id != comment.creator.id} {#if profile.current.jwt && profile.current.user?.local_user_view.person.id != comment.creator.id}
<MenuButton onclick={() => report(comment)} color="danger-subtle"> <MenuButton onclick={() => report(comment)} color="danger-subtle">
<Icon src={Flag} mini size="16" /> <Icon src={Flag} mini size="16" />
<span>{$t('moderation.report')}</span> <span>{$t('moderation.report')}</span>
@@ -51,7 +51,7 @@
let language: number | undefined = $state() let language: number | undefined = $state()
async function submit() { async function submit() {
if (!profile.data?.user || !profile.data?.jwt || value == '') return if (!profile.current?.user || !profile.current?.jwt || value == '') return
loading = true loading = true
@@ -24,7 +24,7 @@
}: Props = $props() }: Props = $props()
const castVote = async (newVote: number) => { const castVote = async (newVote: number) => {
if (!profile.data?.jwt) { if (!profile.current?.jwt) {
toast({ content: $t('toast.loginVoteGate'), type: 'warning' }) toast({ content: $t('toast.loginVoteGate'), type: 'warning' })
return return
} }
@@ -113,7 +113,7 @@
}) })
async function subscribe() { async function subscribe() {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
loading.subscribing = true loading.subscribing = true
const subscribed = const subscribed =
community_view.subscribed == 'Subscribed' || community_view.subscribed == 'Subscribed' ||
@@ -227,7 +227,7 @@
{/if} {/if}
</div> </div>
<div class="flex flex-row items-center gap-1 sticky bottom-0 w-full"> <div class="flex flex-row items-center gap-1 sticky bottom-0 w-full">
{#if profile.data?.jwt} {#if profile.current?.jwt}
<Button <Button
disabled={loading.subscribing} disabled={loading.subscribing}
loading={loading.subscribing} loading={loading.subscribing}
@@ -252,7 +252,7 @@
: $t('cards.community.subscribe')} : $t('cards.community.subscribe')}
</Button> </Button>
{/if} {/if}
{#if profile.data?.user && amMod(profile.data.user, community_view.community)} {#if profile.current?.user && amMod(profile.current.user, community_view.community)}
<Button <Button
href="/c/{fullCommunityName( href="/c/{fullCommunityName(
community_view.community.name, community_view.community.name,
@@ -278,7 +278,7 @@
<Icon src={Newspaper} size="16" mini /> <Icon src={Newspaper} size="16" mini />
{$t('cards.community.modlog')} {$t('cards.community.modlog')}
</MenuButton> </MenuButton>
{#if profile.data?.jwt} {#if profile.current?.jwt}
<MenuButton <MenuButton
color="danger-subtle" color="danger-subtle"
size="lg" size="lg"
@@ -292,7 +292,7 @@
? $t('cards.community.unblock') ? $t('cards.community.unblock')
: $t('cards.community.block')} : $t('cards.community.block')}
</MenuButton> </MenuButton>
{#if profile.data?.user} {#if profile.current?.user}
<MenuButton <MenuButton
color="danger-subtle" color="danger-subtle"
size="lg" size="lg"
@@ -304,7 +304,7 @@
{$t('cards.community.blockInstance')} {$t('cards.community.blockInstance')}
</MenuButton> </MenuButton>
{/if} {/if}
{#if profile.data?.user && isAdmin(profile.data.user)} {#if profile.current?.user && isAdmin(profile.current.user)}
<MenuButton <MenuButton
color="danger-subtle" color="danger-subtle"
onclick={() => onclick={() =>
@@ -64,7 +64,7 @@
let formData = $state(passedFormData) let formData = $state(passedFormData)
async function submit() { async function submit() {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
if ((!edit && formData.name == '') || formData.displayName == '') return if ((!edit && formData.name == '') || formData.displayName == '') return
formData.submitting = true formData.submitting = true
@@ -99,23 +99,23 @@
type: 'success', type: 'success',
}) })
if (profile.data.user) { if (profile.current.user) {
const c = profile.data.user.moderates const c = profile.current.user.moderates
.map(m => m.community.id) .map(m => m.community.id)
.indexOf(res.community_view.community.id) .indexOf(res.community_view.community.id)
if (c != -1) { if (c != -1) {
profile.data.user.moderates[c] = { profile.current.user.moderates[c] = {
community: res.community_view.community, community: res.community_view.community,
moderator: profile.data.user.local_user_view.person, moderator: profile.current.user.local_user_view.person,
} }
} else { } else {
profile.data.user = { profile.current.user = {
...profile.data.user, ...profile.current.user,
moderates: [ moderates: [
...profile.data.user.moderates, ...profile.current.user.moderates,
{ {
community: res.community_view.community, community: res.community_view.community,
moderator: profile.data.user.local_user_view.person, moderator: profile.current.user.local_user_view.person,
}, },
], ],
} }
@@ -115,7 +115,7 @@
</Expandable> </Expandable>
{/if} {/if}
<div class="flex items-center gap-2 h-max w-max"> <div class="flex items-center gap-2 h-max w-max">
{#if profile.data?.jwt} {#if profile.current?.jwt}
<Subscribe <Subscribe
community={{ community={{
community: community, community: community,
@@ -153,7 +153,7 @@
</Subscribe> </Subscribe>
{/if} {/if}
{#if profile.data?.user && profile.data.user.moderates {#if profile.current?.user && profile.current.user.moderates
.map(c => c.community.id) .map(c => c.community.id)
.includes(community.id)} .includes(community.id)}
<Button <Button
@@ -181,7 +181,7 @@
<Icon src={Newspaper} size="16" mini /> <Icon src={Newspaper} size="16" mini />
{$t('cards.community.modlog')} {$t('cards.community.modlog')}
</MenuButton> </MenuButton>
{#if profile.data.user && amMod(profile.data.user, community)} {#if profile.current.user && amMod(profile.current.user, community)}
<MenuButton <MenuButton
color="success-subtle" color="success-subtle"
href="/moderation?community={community.id}" href="/moderation?community={community.id}"
@@ -190,7 +190,7 @@
{$t('routes.moderation.feed')} {$t('routes.moderation.feed')}
</MenuButton> </MenuButton>
{/if} {/if}
{#if profile.data?.jwt} {#if profile.current?.jwt}
<MenuButton <MenuButton
color="danger-subtle" color="danger-subtle"
size="lg" size="lg"
@@ -203,7 +203,7 @@
? $t('cards.community.unblock') ? $t('cards.community.unblock')
: $t('cards.community.block')} : $t('cards.community.block')}
</MenuButton> </MenuButton>
{#if profile.data?.user} {#if profile.current?.user}
<MenuButton <MenuButton
color="danger-subtle" color="danger-subtle"
size="lg" size="lg"
@@ -215,7 +215,7 @@
{$t('cards.community.blockInstance')} {$t('cards.community.blockInstance')}
</MenuButton> </MenuButton>
{/if} {/if}
{#if profile.data?.user && isAdmin(profile.data.user)} {#if profile.current?.user && isAdmin(profile.current.user)}
<MenuButton <MenuButton
color="danger-subtle" color="danger-subtle"
onclick={() => onclick={() =>
@@ -155,7 +155,7 @@
<Subscribe {community}> <Subscribe {community}>
{#snippet children({ subscribe, subscribing })} {#snippet children({ subscribe, subscribing })}
<Button <Button
disabled={subscribing || !profile.data?.jwt} disabled={subscribing || !profile.current?.jwt}
loading={subscribing} loading={subscribing}
onclick={async () => { onclick={async () => {
const res = await subscribe() const res = await subscribe()
@@ -51,14 +51,14 @@
<Option value="Local" icon={MapPin}>{$t('filter.location.local')}</Option> <Option value="Local" icon={MapPin}>{$t('filter.location.local')}</Option>
<Option <Option
value="Subscribed" value="Subscribed"
disabled={profile.data?.jwt == undefined} disabled={profile.current?.jwt == undefined}
icon={Newspaper} icon={Newspaper}
> >
{$t('filter.location.subscribed')} {$t('filter.location.subscribed')}
</Option> </Option>
<Option <Option
value="ModeratorView" value="ModeratorView"
disabled={!profile.data?.jwt || !amModOfAny(profile.data?.user)} disabled={!profile.current?.jwt || !amModOfAny(profile.current?.user)}
icon={ShieldCheck} icon={ShieldCheck}
> >
{$t('filter.location.moderator')} {$t('filter.location.moderator')}
@@ -23,7 +23,7 @@
avatar avatar
avatarSize={20} avatarSize={20}
/> />
{#if profile.data?.user?.local_user_view.person.id != message.recipient.id} {#if profile.current?.user?.local_user_view.person.id != message.recipient.id}
to to
<UserLink <UserLink
showInstance={false} showInstance={false}
@@ -32,7 +32,7 @@
) )
async function upload() { async function upload() {
if (!profile.data?.jwt || image == null) return if (!profile.current?.jwt || image == null) return
progress = 0 progress = 0
@@ -40,7 +40,7 @@
const uploaded = ( const uploaded = (
await Promise.all( await Promise.all(
Array.from(image).map(i => Array.from(image).map(i =>
uploadImage(i, profile.data.instance, profile.data.jwt!) uploadImage(i, profile.current.instance, profile.current.jwt!)
.then(uploaded => { .then(uploaded => {
progress += 1 / (image?.length ?? 0) progress += 1 / (image?.length ?? 0)
return uploaded return uploaded
@@ -23,7 +23,7 @@
let loading = $state(false) let loading = $state(false)
async function sendMessage() { async function sendMessage() {
if (!profile.data?.jwt || message == '') return if (!profile.current?.jwt || message == '') return
loading = true loading = true
@@ -45,7 +45,7 @@
}) })
async function submit() { async function submit() {
if (!item || !profile.data?.user || !profile.data?.jwt) return if (!item || !profile.current?.user || !profile.current?.jwt) return
loading = true loading = true
@@ -34,9 +34,9 @@
<ShieldIcon filled width={14} /> <ShieldIcon filled width={14} />
</Button> </Button>
{/snippet} {/snippet}
{#if (profile.data?.user && amMod(profile.data.user, item.community)) || (profile.data?.user && isAdmin(profile.data.user))} {#if (profile.current?.user && amMod(profile.current.user, item.community)) || (profile.current?.user && isAdmin(profile.current.user))}
<MenuDivider> <MenuDivider>
{#if !item.community.local && !amMod(profile.data.user, item.community)} {#if !item.community.local && !amMod(profile.current.user, item.community)}
{$t('moderation.labelInstanceOnly')} {$t('moderation.labelInstanceOnly')}
{:else} {:else}
{$t('moderation.label')} {$t('moderation.label')}
@@ -52,7 +52,7 @@
: $t('moderation.remove')} : $t('moderation.remove')}
{/if} {/if}
</MenuButton> </MenuButton>
{#if profile.data?.user && profile.data.user?.local_user_view.person.id != item.creator.id} {#if profile.current?.user && profile.current.user?.local_user_view.person.id != item.creator.id}
<!--Comment made by someone else--> <!--Comment made by someone else-->
<MenuButton <MenuButton
color="danger-subtle" color="danger-subtle"
@@ -71,12 +71,12 @@
<MenuButton <MenuButton
color="success-subtle" color="success-subtle"
onclick={async () => { onclick={async () => {
if (!profile.data.jwt) return if (!profile.current.jwt) return
item.comment = ( item.comment = (
await feature( await feature(
!item.comment.distinguished, !item.comment.distinguished,
item.comment, item.comment,
profile.data.jwt, profile.current.jwt,
) )
).comment_view.comment ).comment_view.comment
}} }}
@@ -104,7 +104,7 @@
</MenuButton> </MenuButton>
{/if} {/if}
{#if profile.data?.user && isAdmin(profile.data.user)} {#if profile.current?.user && isAdmin(profile.current.user)}
<MenuDivider>{$t('admin.label')}</MenuDivider> <MenuDivider>{$t('admin.label')}</MenuDivider>
<MenuButton color="danger-subtle" onclick={() => remove(item, true)}> <MenuButton color="danger-subtle" onclick={() => remove(item, true)}>
{#snippet prefix()} {#snippet prefix()}
@@ -32,7 +32,7 @@
let acting = $derived(locking || pinning) let acting = $derived(locking || pinning)
async function lock(lock: boolean) { async function lock(lock: boolean) {
if (!profile.data?.jwt || !isPostView(item)) return if (!profile.current?.jwt || !isPostView(item)) return
locking = true locking = true
try { try {
@@ -53,7 +53,7 @@
} }
async function pin(pinned: boolean, toInstance: boolean = false) { async function pin(pinned: boolean, toInstance: boolean = false) {
if (!profile.data?.jwt || !isPostView(item)) return if (!profile.current?.jwt || !isPostView(item)) return
pinning = true pinning = true
@@ -88,9 +88,9 @@
<ShieldIcon filled width={16} /> <ShieldIcon filled width={16} />
</Button> </Button>
{/snippet} {/snippet}
{#if (profile.data?.user && amMod(profile.data.user, item.community)) || (profile.data?.user && isAdmin(profile.data.user))} {#if (profile.current?.user && amMod(profile.current.user, item.community)) || (profile.current?.user && isAdmin(profile.current.user))}
<MenuDivider> <MenuDivider>
{#if !item.community.local && !amMod(profile.data.user, item.community)} {#if !item.community.local && !amMod(profile.current.user, item.community)}
{$t('moderation.labelInstanceOnly')} {$t('moderation.labelInstanceOnly')}
{:else} {:else}
{$t('moderation.label')} {$t('moderation.label')}
@@ -124,7 +124,7 @@
? $t('moderation.unfeature') ? $t('moderation.unfeature')
: $t('moderation.feature')} : $t('moderation.feature')}
</span> </span>
{#if isAdmin(profile.data.user)} {#if isAdmin(profile.current.user)}
<span class="text-xs opacity-80">{$t('form.post.community')}</span> <span class="text-xs opacity-80">{$t('form.post.community')}</span>
{/if} {/if}
</div> </div>
@@ -139,7 +139,7 @@
{item.post.removed ? $t('moderation.restore') : $t('moderation.remove')} {item.post.removed ? $t('moderation.restore') : $t('moderation.remove')}
{/if} {/if}
</MenuButton> </MenuButton>
{#if profile.data?.user && profile.data.user.local_user_view.person.id != item.creator.id} {#if profile.current?.user && profile.current.user.local_user_view.person.id != item.creator.id}
<MenuButton <MenuButton
color="danger-subtle" color="danger-subtle"
onclick={() => onclick={() =>
@@ -164,7 +164,7 @@
{$t('moderation.votes')} {$t('moderation.votes')}
</MenuButton> </MenuButton>
{/if} {/if}
{#if profile.data?.user && isAdmin(profile.data.user)} {#if profile.current?.user && isAdmin(profile.current.user)}
<MenuDivider>{$t('admin.label')}</MenuDivider> <MenuDivider>{$t('admin.label')}</MenuDivider>
<MenuButton <MenuButton
color="success-subtle" color="success-subtle"
@@ -76,7 +76,7 @@
async function remove() { async function remove() {
if (!item) return if (!item) return
if (!profile.data?.jwt) throw new Error('Unauthenticated') if (!profile.current?.jwt) throw new Error('Unauthenticated')
loading = true loading = true
@@ -216,7 +216,7 @@
bind:value={reason} bind:value={reason}
/> />
{#if !removed && profile.data?.user && (amMod(profile.data.user, item.community) || (isAdmin(profile.data.user) && item.community.local))} {#if !removed && profile.current?.user && (amMod(profile.current.user, item.community) || (isAdmin(profile.current.user) && item.community.local))}
<Switch bind:checked={commentReason}> <Switch bind:checked={commentReason}>
{$t('moderation.removeSubmission.withReason')} {$t('moderation.removeSubmission.withReason')}
</Switch> </Switch>
@@ -39,7 +39,7 @@
let reason = $state('') let reason = $state('')
async function report() { async function report() {
if (!item || !profile.data?.jwt || reason == '') return if (!item || !profile.current?.jwt || reason == '') return
loading = true loading = true
try { try {
+1 -1
View File
@@ -117,7 +117,7 @@
user={post.creator} user={post.creator}
published={publishedToDate(post.post.published)} published={publishedToDate(post.post.published)}
{badges} {badges}
subscribed={profile.data?.user?.follows subscribed={profile.current?.user?.follows
.map(c => c.community.id) .map(c => c.community.id)
.includes(post.community.id) .includes(post.community.id)
? 'Subscribed' ? 'Subscribed'
@@ -117,8 +117,8 @@
score={post.counts.score} score={post.counts.score}
upvotes={post.counts.upvotes} upvotes={post.counts.upvotes}
downvotes={post.counts.downvotes} downvotes={post.counts.downvotes}
showCounts={profile.data?.user?.local_user_view?.local_user?.show_scores ?? showCounts={profile.current?.user?.local_user_view?.local_user
true} ?.show_scores ?? true}
/> />
<Button <Button
@@ -160,7 +160,7 @@
{/snippet} {/snippet}
</Button> </Button>
{/if} {/if}
{#if profile.data?.user && (amMod(profile.data.user, post.community) || isAdmin(profile.data.user))} {#if profile.current?.user && (amMod(profile.current.user, post.community) || isAdmin(profile.current.user))}
<ModerationMenu <ModerationMenu
size="custom" size="custom"
color="ghost" color="ghost"
@@ -171,10 +171,10 @@
/> />
{/if} {/if}
{#if profile.data?.jwt} {#if profile.current?.jwt}
<Button <Button
onclick={async () => { onclick={async () => {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
saving = true saving = true
post.saved = await save(post, !post.saved) post.saved = await save(post, !post.saved)
saving = false saving = false
@@ -228,7 +228,7 @@
<MenuDivider> <MenuDivider>
{$t('post.actions.more.actions')} {$t('post.actions.more.actions')}
</MenuDivider> </MenuDivider>
{#if profile.data?.user && profile.data?.jwt && profile.data.user.local_user_view.person.id == post.creator.id} {#if profile.current?.user && profile.current?.jwt && profile.current.user.local_user_view.person.id == post.creator.id}
<MenuButton onclick={() => (editing = true)}> <MenuButton onclick={() => (editing = true)}>
{#snippet prefix()} {#snippet prefix()}
<Icon src={PencilSquare} size="16" micro /> <Icon src={PencilSquare} size="16" micro />
@@ -236,10 +236,10 @@
{$t('post.actions.more.edit')} {$t('post.actions.more.edit')}
</MenuButton> </MenuButton>
{/if} {/if}
{#if profile.data?.jwt} {#if profile.current?.jwt}
<MenuButton <MenuButton
onclick={async () => { onclick={async () => {
if (profile.data?.jwt) if (profile.current?.jwt)
post.read = await markAsRead(post.post, !post.read) post.read = await markAsRead(post.post, !post.read)
}} }}
> >
@@ -297,7 +297,7 @@
</div> </div>
{/if} {/if}
</MenuButton> </MenuButton>
{#if profile.data?.jwt} {#if profile.current?.jwt}
<MenuButton <MenuButton
onclick={() => { onclick={() => {
setSessionStorage('postDraft', { setSessionStorage('postDraft', {
@@ -326,10 +326,10 @@
{/snippet} {/snippet}
{$t('post.actions.more.crosspost')} {$t('post.actions.more.crosspost')}
</MenuButton> </MenuButton>
{#if profile.data.user && post.creator.id == profile.data.user.local_user_view.person.id} {#if profile.current.user && post.creator.id == profile.current.user.local_user_view.person.id}
<MenuButton <MenuButton
onclick={async () => { onclick={async () => {
if (profile.data?.jwt) if (profile.current?.jwt)
post.post.deleted = await deleteItem(post, !post.post.deleted) post.post.deleted = await deleteItem(post, !post.post.deleted)
}} }}
color="danger-subtle" color="danger-subtle"
@@ -342,15 +342,15 @@
: $t('post.actions.more.delete')} : $t('post.actions.more.delete')}
</MenuButton> </MenuButton>
{/if} {/if}
{#if profile.data.user?.local_user_view.person.id != post.creator.id} {#if profile.current.user?.local_user_view.person.id != post.creator.id}
{#if feature('hidePosts', site.data?.version)} {#if feature('hidePosts', site.data?.version)}
<MenuButton <MenuButton
onclick={async () => { onclick={async () => {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
const hidden = await hidePost( const hidden = await hidePost(
post.post.id, post.post.id,
!post.hidden, !post.hidden,
profile.data?.jwt, profile.current?.jwt,
) )
post.hidden = hidden post.hidden = hidden
if (hidden) onhide?.(hidden) if (hidden) onhide?.(hidden)
@@ -51,7 +51,7 @@
let loading = $state(false) let loading = $state(false)
const castVote = async (newVote: number) => { const castVote = async (newVote: number) => {
if (!profile.data?.jwt) { if (!profile.current?.jwt) {
toast({ content: $t('toast.loginVoteGate'), type: 'warning' }) toast({ content: $t('toast.loginVoteGate'), type: 'warning' })
return return
} }
@@ -134,7 +134,7 @@
}) })
return return
} }
if (!data.title || !profile.data?.jwt) return if (!data.title || !profile.current?.jwt) return
if (data.url && data.url != '') { if (data.url && data.url != '') {
try { try {
new URL(data.url) new URL(data.url)
@@ -275,7 +275,7 @@
<ObjectAutocomplete <ObjectAutocomplete
bind:q={communitySearch} bind:q={communitySearch}
items={communities} items={communities}
jwt={profile.data?.jwt} jwt={profile.current?.jwt}
listing_type="All" listing_type="All"
label={$t('form.post.community')} label={$t('form.post.community')}
required required
@@ -42,7 +42,7 @@
).users.map(c => c.person) ).users.map(c => c.person)
if (hideOwnUser) { if (hideOwnUser) {
const myself = profile.data.user?.local_user_view.person.id const myself = profile.current.user?.local_user_view.person.id
return users.filter(c => c.id != myself) return users.filter(c => c.id != myself)
} }
return users return users
+14 -14
View File
@@ -86,7 +86,7 @@
style="border-radius: inherit;" style="border-radius: inherit;"
> >
<div class="ml-auto"></div> <div class="ml-auto"></div>
{#if profile.data?.user && isAdmin(profile.data.user)} {#if profile.current?.user && isAdmin(profile.current.user)}
<NavButton <NavButton
href="/admin" href="/admin"
label={$t('nav.admin')} label={$t('nav.admin')}
@@ -95,7 +95,7 @@
isSelectedFilter={path => path.startsWith('/admin')} isSelectedFilter={path => path.startsWith('/admin')}
/> />
{/if} {/if}
{#if amModOfAny(profile.data?.user)} {#if amModOfAny(profile.current?.user)}
<NavButton <NavButton
href="/moderation" href="/moderation"
label={$t('nav.moderation')} label={$t('nav.moderation')}
@@ -109,10 +109,10 @@
icon={GlobeAlt} icon={GlobeAlt}
/> />
<NavButton href="/search" label={$t('nav.search')} icon={MagnifyingGlass} /> <NavButton href="/search" label={$t('nav.search')} icon={MagnifyingGlass} />
{#if profile.data.jwt} {#if profile.current.jwt}
{@const linkOnly = {@const linkOnly =
!profile.data.user || !profile.current.user ||
!(isAdmin(profile.data.user) || amModOfAny(profile.data.user))} !(isAdmin(profile.current.user) || amModOfAny(profile.current.user))}
<Menu manual={linkOnly} placement="top"> <Menu manual={linkOnly} placement="top">
{#snippet target()} {#snippet target()}
<NavButton <NavButton
@@ -136,7 +136,7 @@
{@render notifBadge($notifications.inbox)} {@render notifBadge($notifications.inbox)}
{/snippet} {/snippet}
</MenuButton> </MenuButton>
{#if amModOfAny(profile.data.user)} {#if amModOfAny(profile.current.user)}
<MenuButton href="/moderation" icon={ShieldCheck}> <MenuButton href="/moderation" icon={ShieldCheck}>
{$t('routes.moderation.feed')} {$t('routes.moderation.feed')}
{#snippet suffix()} {#snippet suffix()}
@@ -144,7 +144,7 @@
{/snippet} {/snippet}
</MenuButton> </MenuButton>
{/if} {/if}
{#if profile.data.user && isAdmin(profile.data.user)} {#if profile.current.user && isAdmin(profile.current.user)}
<MenuButton href="/admin/applications" icon={ServerStack}> <MenuButton href="/admin/applications" icon={ServerStack}>
{$t('routes.admin.applications.title')} {$t('routes.admin.applications.title')}
{#snippet suffix()} {#snippet suffix()}
@@ -156,7 +156,7 @@
{/if} {/if}
<Menu <Menu
manual={site.data?.site_view.local_site.community_creation_admin_only && manual={site.data?.site_view.local_site.community_creation_admin_only &&
!(profile.data.user && isAdmin(profile.data.user))} !(profile.current.user && isAdmin(profile.current.user))}
placement="top" placement="top"
> >
{#snippet target()} {#snippet target()}
@@ -166,13 +166,13 @@
icon={Plus} icon={Plus}
adaptive={false} adaptive={false}
href={site.data?.site_view.local_site.community_creation_admin_only && href={site.data?.site_view.local_site.community_creation_admin_only &&
!(profile.data.user && isAdmin(profile.data.user)) !(profile.current.user && isAdmin(profile.current.user))
? '/create/post' ? '/create/post'
: undefined} : undefined}
/> />
{/snippet} {/snippet}
<MenuDivider>{$t('nav.create.label')}</MenuDivider> <MenuDivider>{$t('nav.create.label')}</MenuDivider>
<MenuButton link href="/create/post" disabled={!profile.data?.jwt}> <MenuButton link href="/create/post" disabled={!profile.current?.jwt}>
{#snippet prefix()} {#snippet prefix()}
<Icon src={PencilSquare} size="16" micro /> <Icon src={PencilSquare} size="16" micro />
{/snippet} {/snippet}
@@ -181,17 +181,17 @@
<MenuButton <MenuButton
link link
href="/create/community" href="/create/community"
disabled={!profile.data?.jwt || disabled={!profile.current?.jwt ||
!profile.data?.user || !profile.current?.user ||
(site.data?.site_view.local_site.community_creation_admin_only && (site.data?.site_view.local_site.community_creation_admin_only &&
!isAdmin(profile.data.user))} !isAdmin(profile.current.user))}
> >
{#snippet prefix()} {#snippet prefix()}
<Icon src={Newspaper} size="16" micro /> <Icon src={Newspaper} size="16" micro />
{/snippet} {/snippet}
{$t('nav.create.community')} {$t('nav.create.community')}
</MenuButton> </MenuButton>
{#if !profile.data?.jwt} {#if !profile.current?.jwt}
<span class="text-sm mx-4 my-1 py-1"> <span class="text-sm mx-4 my-1 py-1">
{$t('nav.create.logingate')} {$t('nav.create.logingate')}
</span> </span>
+4 -4
View File
@@ -72,14 +72,14 @@
hover:bg-slate-200 dark:hover:bg-zinc-700 group cursor-pointer {buttonClass}" hover:bg-slate-200 dark:hover:bg-zinc-700 group cursor-pointer {buttonClass}"
title={$t('profile.profile')} title={$t('profile.profile')}
> >
{#if profile.data?.user} {#if profile.current?.user}
<div <div
class="w-full h-full aspect-square object-cover rounded-full grid place-items-center group-hover:scale-90 transition-transform group-active:scale-[85%]" class="w-full h-full aspect-square object-cover rounded-full grid place-items-center group-hover:scale-90 transition-transform group-active:scale-[85%]"
> >
<Avatar <Avatar
url={profile.data.user.local_user_view.person.avatar} url={profile.current.user.local_user_view.person.avatar}
width={36} width={36}
alt={profile.data.user.local_user_view.person.name} alt={profile.current.user.local_user_view.person.name}
/> />
</div> </div>
{:else} {:else}
@@ -90,7 +90,7 @@
</button> </button>
{/snippet} {/snippet}
<MenuDivider>{$t('nav.menu.label')}</MenuDivider> <MenuDivider>{$t('nav.menu.label')}</MenuDivider>
{#if profile.data?.jwt} {#if profile.current?.jwt}
<MenuButton href="/profile"> <MenuButton href="/profile">
{#snippet prefix()} {#snippet prefix()}
<Icon src={UserCircle} micro size="16" /> <Icon src={UserCircle} micro size="16" />
@@ -23,7 +23,7 @@
$effect(() => { $effect(() => {
groups = getGroups( groups = getGroups(
$resumables, $resumables,
profile.data, profile.current,
profileData.profiles, profileData.profiles,
theme.data, theme.data,
page.data.contextual?.actions, page.data.contextual?.actions,
@@ -25,7 +25,7 @@
animate:flip={{ duration: 500, easing: expoOut }} animate:flip={{ duration: 500, easing: expoOut }}
> >
<div class="flex-none grid group"> <div class="flex-none grid group">
{#if profile && !hasFavorite(profile.data, follow.id)} {#if profile && !hasFavorite(profile.current, follow.id)}
<Button <Button
rounding="pill" rounding="pill"
size="custom" size="custom"
@@ -36,7 +36,7 @@
> >
<Icon src={Star} size="16" mini /> <Icon src={Star} size="16" mini />
</Button> </Button>
{:else if isFavorites && profile && hasFavorite(profile.data, follow.id)} {:else if isFavorites && profile && hasFavorite(profile.current, follow.id)}
<Button <Button
rounding="pill" rounding="pill"
size="custom" size="custom"
@@ -53,7 +53,9 @@
alt={follow.name} alt={follow.name}
title={follow.title} title={follow.title}
width={28} width={28}
class={!isFavorites && profile && hasFavorite(profile.data, follow.id) class={!isFavorites &&
profile &&
hasFavorite(profile.current, follow.id)
? '' ? ''
: 'group-hover:hidden'} : 'group-hover:hidden'}
/> />
@@ -23,11 +23,11 @@
loading={switching} loading={switching}
rounding="lg" rounding="lg"
loaderWidth={22} loaderWidth={22}
selected={profile.data?.id == prof.id} selected={profile.current?.id == prof.id}
onclick={async () => { onclick={async () => {
switching = true switching = true
if (profile.data?.id != prof.id) { if (profile.current?.id != prof.id) {
await setUserID(prof.id) await setUserID(prof.id)
} }
@@ -37,7 +37,7 @@
switching = false switching = false
}} }}
class="w-full font-normal {profile.data?.id == prof.id class="w-full font-normal {profile.current?.id == prof.id
? 'bg-slate-100! dark:bg-zinc-900!' ? 'bg-slate-100! dark:bg-zinc-900!'
: ''}" : ''}"
> >
@@ -46,11 +46,11 @@
profile={prof} profile={prof}
{index} {index}
{guest} {guest}
selected={profile.data?.id == prof.id} selected={profile.current?.id == prof.id}
/> />
{/snippet} {/snippet}
<span <span
class="inline-flex flex-col gap-0 {profile.data?.id == prof.id class="inline-flex flex-col gap-0 {profile.current?.id == prof.id
? 'font-semibold' ? 'font-semibold'
: ''}" : ''}"
> >
+12 -10
View File
@@ -31,7 +31,7 @@
class={['flex flex-col p-4 overflow-auto gap-1 h-fit max-h-screen', clazz]} class={['flex flex-col p-4 overflow-auto gap-1 h-fit max-h-screen', clazz]}
{style} {style}
> >
{#if profile.data?.jwt} {#if profile.current?.jwt}
<SidebarButton icon={UserCircle} href="/profile"> <SidebarButton icon={UserCircle} href="/profile">
{#snippet label()} {#snippet label()}
<span> <span>
@@ -120,7 +120,7 @@
</Expandable> </Expandable>
{/if} {/if}
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
{#if profile.data?.favorites && profile.data?.favorites.length > 0} {#if profile.current?.favorites && profile.current?.favorites.length > 0}
<Expandable <Expandable
class="max-w-full min-w-0 w-full" class="max-w-full min-w-0 w-full"
bind:open={settings.expand.favorites} bind:open={settings.expand.favorites}
@@ -131,18 +131,18 @@
{$t('routes.profile.favorites')} {$t('routes.profile.favorites')}
{#snippet action()} {#snippet action()}
<span class="dark:text-white text-black"> <span class="dark:text-white text-black">
{profile.data.favorites?.length} {profile.current.favorites?.length}
</span> </span>
{/snippet} {/snippet}
</EndPlaceholder> </EndPlaceholder>
</span> </span>
{/snippet} {/snippet}
<CommunityList isFavorites items={profile.data.favorites} /> <CommunityList isFavorites items={profile.current.favorites} />
</Expandable> </Expandable>
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
{/if} {/if}
{#if profile.data?.user} {#if profile.current?.user}
{#if profile.data?.user.moderates.length > 0} {#if profile.current?.user.moderates.length > 0}
<Expandable <Expandable
class="max-w-full min-w-0 w-full" class="max-w-full min-w-0 w-full"
bind:open={settings.expand.moderates} bind:open={settings.expand.moderates}
@@ -153,14 +153,14 @@
{$t('routes.profile.moderates')} {$t('routes.profile.moderates')}
{#snippet action()} {#snippet action()}
<span class="dark:text-white text-black"> <span class="dark:text-white text-black">
{profile.data.user?.moderates.length} {profile.current.user?.moderates.length}
</span> </span>
{/snippet} {/snippet}
</EndPlaceholder> </EndPlaceholder>
</span> </span>
{/snippet} {/snippet}
<CommunityList <CommunityList
items={profile.data.user.moderates.map(i => i.community)} items={profile.current.user.moderates.map(i => i.community)}
/> />
</Expandable> </Expandable>
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
@@ -176,13 +176,15 @@
{$t('profile.subscribed')} {$t('profile.subscribed')}
{#snippet action()} {#snippet action()}
<span class="dark:text-white text-black"> <span class="dark:text-white text-black">
{profile.data.user?.follows.length} {profile.current.user?.follows.length}
</span> </span>
{/snippet} {/snippet}
</EndPlaceholder> </EndPlaceholder>
</span> </span>
{/snippet} {/snippet}
<CommunityList items={profile.data.user.follows.map(i => i.community)} /> <CommunityList
items={profile.current.user.follows.map(i => i.community)}
/>
</Expandable> </Expandable>
{/if} {/if}
</nav> </nav>
+1 -1
View File
@@ -3,7 +3,7 @@ import { env } from '$env/dynamic/public'
import { profile } from './auth.svelte' import { profile } from './auth.svelte'
class InstanceData { class InstanceData {
#instance = $derived(profile.data.instance) #instance = $derived(profile.current.instance)
get data() { get data() {
return this.#instance ?? DEFAULT_INSTANCE_URL return this.#instance ?? DEFAULT_INSTANCE_URL
+3 -2
View File
@@ -59,9 +59,10 @@ export function client({
) => Promise<Response> ) => Promise<Response>
auth?: string auth?: string
} = {}) { } = {}) {
if (!instanceURL) instanceURL = profile.data.instance || DEFAULT_INSTANCE_URL if (!instanceURL)
instanceURL = profile.current.instance || DEFAULT_INSTANCE_URL
const jwt = auth ? auth : profile.data?.jwt const jwt = auth ? auth : profile.current?.jwt
const headers = jwt ? { authorization: `Bearer ${jwt}` } : {} const headers = jwt ? { authorization: `Bearer ${jwt}` } : {}
+2 -2
View File
@@ -106,12 +106,12 @@ function resumableStore(limit: number = 10) {
export const resumables = resumableStore() export const resumables = resumableStore()
export function addFavorite(item: Community, add: boolean = true) { export function addFavorite(item: Community, add: boolean = true) {
const favs = profile.data.favorites ?? [] const favs = profile.current.favorites ?? []
if (favs.map(fav => fav.id).includes(item.id)) if (add) return if (favs.map(fav => fav.id).includes(item.id)) if (add) return
if (!add) { if (!add) {
favs.splice(favs.map(c => c.id).indexOf(item.id), 1) favs.splice(favs.map(c => c.id).indexOf(item.id), 1)
} else { } else {
favs.unshift(item) favs.unshift(item)
} }
profile.data.favorites = favs profile.current.favorites = favs
} }
+5 -5
View File
@@ -6,7 +6,7 @@ import type { Community, MyUserInfo } from 'lemmy-js-client'
// TODO obliterate this file // TODO obliterate this file
export const blockUser = async (block: boolean, id: number) => { export const blockUser = async (block: boolean, id: number) => {
const auth = profile.data?.jwt const auth = profile.current?.jwt
if (!auth) throw new Error('Unauthorized') if (!auth) throw new Error('Unauthorized')
@@ -23,17 +23,17 @@ export const addSubscription = (
community: Community, community: Community,
subscribe: boolean = true, subscribe: boolean = true,
) => { ) => {
const index = profile.data.user?.follows const index = profile.current.user?.follows
.map(f => f.community.id) .map(f => f.community.id)
.indexOf(community.id) .indexOf(community.id)
if (subscribe && index == -1) { if (subscribe && index == -1) {
profile.data.user?.follows.push({ profile.current.user?.follows.push({
follower: profile.data.user.follows[0]?.follower, follower: profile.current.user.follows[0]?.follower,
community: community, community: community,
}) })
} else { } else {
profile.data.user?.follows.splice(index ?? 0, 1) profile.current.user?.follows.splice(index ?? 0, 1)
} }
} }
+5 -3
View File
@@ -38,14 +38,14 @@
let switching = $state(-1) let switching = $state(-1)
let radioSelected = $state(profile.data.id) let radioSelected = $state(profile.current.id)
$effect(() => { $effect(() => {
switching = radioSelected switching = radioSelected
setUserID(radioSelected) setUserID(radioSelected)
}) })
$effect(() => { $effect(() => {
if (profile.data.user) switching = -1 if (profile.current.user) switching = -1
}) })
</script> </script>
@@ -55,7 +55,9 @@
{#if debugging} {#if debugging}
<DebugObject <DebugObject
object={debugProfile?.id == profile.data?.id ? profile.data : debugProfile} object={debugProfile?.id == profile.current?.id
? profile.current
: debugProfile}
bind:open={debugging} bind:open={debugging}
> >
{#snippet title()} {#snippet title()}
@@ -8,7 +8,7 @@ export async function load({ fetch, url }) {
const uri = url.searchParams.get('uri') const uri = url.searchParams.get('uri')
if (!uri) error(404) if (!uri) error(404)
if (!profile.data.jwt) if (!profile.current.jwt)
redirect(302, `/login?ref=${encodeURIComponent(url.toString())}`) redirect(302, `/login?ref=${encodeURIComponent(url.toString())}`)
return { return {
+1 -1
View File
@@ -5,7 +5,7 @@ import { ReactiveState } from '$lib/promise.svelte.js'
export async function load({ fetch, url }) { export async function load({ fetch, url }) {
if (!profile) return if (!profile) return
const { jwt } = profile.data! const { jwt } = profile.current!
if (!jwt) return if (!jwt) return
const page = Number(url.searchParams.get('page')) || 1 const page = Number(url.searchParams.get('page')) || 1
@@ -33,7 +33,7 @@
let reviewing = $state(false) let reviewing = $state(false)
async function review(approve: boolean) { async function review(approve: boolean) {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
let registrationApplicationAnswer: ApproveRegistrationApplication = { let registrationApplicationAnswer: ApproveRegistrationApplication = {
approve: approve, approve: approve,
@@ -67,7 +67,7 @@
type: 'success', type: 'success',
}) })
application.creator_local_user.accepted_application = approve application.creator_local_user.accepted_application = approve
application.admin = profile.data.user!.local_user_view.person application.admin = profile.current.user!.local_user_view.person
application.registration_application.deny_reason = denyReason application.registration_application.deny_reason = denyReason
$notifications.applications -= 1 $notifications.applications -= 1
+1 -1
View File
@@ -42,7 +42,7 @@
) )
async function save() { async function save() {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
saving = true saving = true
+2 -2
View File
@@ -44,7 +44,7 @@
if (instance == '') return if (instance == '') return
await trycatch(async () => { await trycatch(async () => {
if ( if (
!profile.data?.jwt || !profile.current?.jwt ||
!data.federated_instances?.federated_instances?.blocked || !data.federated_instances?.federated_instances?.blocked ||
!data.federated_instances?.federated_instances?.allowed !data.federated_instances?.federated_instances?.allowed
) )
@@ -81,7 +81,7 @@
const save = async () => { const save = async () => {
const res = await trycatch(async () => { const res = await trycatch(async () => {
if ( if (
!profile.data?.jwt || !profile.current?.jwt ||
!data.federated_instances?.federated_instances?.blocked !data.federated_instances?.federated_instances?.blocked
) )
return return
+1 -1
View File
@@ -3,7 +3,7 @@ import { client } from '$lib/lemmy.svelte.js'
import { ReactiveState } from '$lib/promise.svelte.js' import { ReactiveState } from '$lib/promise.svelte.js'
export async function load({ fetch, url }) { export async function load({ fetch, url }) {
const { jwt } = profile.data const { jwt } = profile.current
const page = Number(url.searchParams.get('page')) || 1 const page = Number(url.searchParams.get('page')) || 1
+1 -1
View File
@@ -23,7 +23,7 @@
let saving = $state(false) let saving = $state(false)
async function save() { async function save() {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
saving = true saving = true
+2 -2
View File
@@ -29,7 +29,7 @@
action: () => removeAdmin(id, true), action: () => removeAdmin(id, true),
}) })
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
const result = await trycatch(() => const result = await trycatch(() =>
getClient().addAdmin({ getClient().addAdmin({
@@ -77,7 +77,7 @@
class="flex flex-row items-center gap-2 mt-auto w-full" class="flex flex-row items-center gap-2 mt-auto w-full"
onsubmit={preventDefault(() => { onsubmit={preventDefault(() => {
trycatch(async () => { trycatch(async () => {
if (!profile.data?.jwt || newAdmin == '') return if (!profile.current?.jwt || newAdmin == '') return
adding = true adding = true
const r = await addAdmin(`${newAdmin}@${instance.data}`, true) const r = await addAdmin(`${newAdmin}@${instance.data}`, true)
+3 -3
View File
@@ -81,10 +81,10 @@
{/snippet} {/snippet}
</Header> </Header>
{#if profile.data.user} {#if profile.current.user}
{#if !data.community.value.discussion_languages.every( l => profile.data.user?.discussion_languages.includes(l), ) && profile.data.user.discussion_languages.length > 0} {#if !data.community.value.discussion_languages.every( l => profile.current.user?.discussion_languages.includes(l), ) && profile.current.user.discussion_languages.length > 0}
{@const missing = data.community.value.discussion_languages.filter( {@const missing = data.community.value.discussion_languages.filter(
i => !profile.data.user?.discussion_languages.includes(i), i => !profile.current.user?.discussion_languages.includes(i),
)} )}
<Note class="p-1! pl-3! flex-col md:flex-row"> <Note class="p-1! pl-3! flex-col md:flex-row">
<div>{$t('routes.community.languageWarning')}</div> <div>{$t('routes.community.languageWarning')}</div>
@@ -23,7 +23,7 @@
}) })
async function addModerator() { async function addModerator() {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
formData.addingModerator = true formData.addingModerator = true
@@ -80,7 +80,7 @@
} }
async function removeMod(id: number) { async function removeMod(id: number) {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
try { try {
const res = await getClient().addModToCommunity({ const res = await getClient().addModToCommunity({
+3 -3
View File
@@ -4,11 +4,11 @@ import { client } from '$lib/lemmy.svelte.js'
import { redirect } from '@sveltejs/kit' import { redirect } from '@sveltejs/kit'
export async function load({ params, fetch }) { export async function load({ params, fetch }) {
if (profile.data.instance != params.instance) if (profile.current.instance != params.instance)
redirect(302, resolveRoute('/comment/[instance]/[id]/confirm', params)) redirect(302, resolveRoute('/comment/[instance]/[id]/confirm', params))
const comment = await client({ const comment = await client({
instanceURL: profile.data.instance, instanceURL: profile.current.instance,
func: fetch, func: fetch,
}).getComment({ }).getComment({
id: Number(params.id), id: Number(params.id),
@@ -16,6 +16,6 @@ export async function load({ params, fetch }) {
redirect( redirect(
302, 302,
`/post/${profile.data.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}`, `/post/${profile.current.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}`,
) )
} }
@@ -15,7 +15,7 @@
import { Plus } from 'svelte-hero-icons' import { Plus } from 'svelte-hero-icons'
let loading = $state(false) let loading = $state(false)
const fetched = $state.snapshot(profile.data.instance) const fetched = $state.snapshot(profile.current.instance)
async function fetchOnHome() { async function fetchOnHome() {
loading = true loading = true
@@ -27,7 +27,7 @@
if (res.comment) { if (res.comment) {
goto( goto(
resolveRoute(`/comment/[instance]/[id]`, { resolveRoute(`/comment/[instance]/[id]`, {
instance: profile.data.instance, instance: profile.current.instance,
id: res.comment.comment.id.toString(), id: res.comment.comment.id.toString(),
}), }),
) )
@@ -56,7 +56,7 @@
</p> </p>
</header> </header>
<div class="flex flex-row items-center gap-2 flex-wrap"> <div class="flex flex-row items-center gap-2 flex-wrap">
{#if profile.data.jwt} {#if profile.current.jwt}
<Button <Button
{loading} {loading}
disabled={loading} disabled={loading}
@@ -2,6 +2,6 @@ import { profile } from '$lib/auth.svelte.js'
import { redirect } from '@sveltejs/kit' import { redirect } from '@sveltejs/kit'
export async function load({ params }) { export async function load({ params }) {
if (profile.data.instance == params.instance) if (profile.current.instance == params.instance)
redirect(302, `/comment/${params.instance}/${params.id}`) redirect(302, `/comment/${params.instance}/${params.id}`)
} }
+1 -1
View File
@@ -32,7 +32,7 @@
id: number | undefined = community?.community.id, id: number | undefined = community?.community.id,
subscribed: SubscribedType | undefined = community?.subscribed, subscribed: SubscribedType | undefined = community?.subscribed,
) { ) {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
if (!id || !subscribed) return if (!id || !subscribed) return
subscribing = true subscribing = true
+1 -1
View File
@@ -10,7 +10,7 @@
let { data } = $props() let { data } = $props()
onMount(() => { onMount(() => {
if (!profile.data?.jwt) { if (!profile.current?.jwt) {
goto('/login') goto('/login')
} }
}) })
+2 -2
View File
@@ -19,7 +19,7 @@
let markingAsRead = $state(false) let markingAsRead = $state(false)
async function markAllAsRead() { async function markAllAsRead() {
if (!profile.data?.user) { if (!profile.current?.user) {
goto('/login') goto('/login')
return return
} }
@@ -156,7 +156,7 @@ items-center px-2 w-max top-6 lg:top-22"
/> />
{:else} {:else}
{#each data.inbox.value as item, index} {#each data.inbox.value as item, index}
{#if item.creator.id != profile.data.user?.local_user_view.person.id} {#if item.creator.id != profile.current.user?.local_user_view.person.id}
<div <div
class="-mx-4 sm:-mx-6 px-4 sm:px-6 class="-mx-4 sm:-mx-6 px-4 sm:px-6
{item.read ? '' : 'bg-blue-50/50 dark:bg-blue-500/5'}" {item.read ? '' : 'bg-blue-50/50 dark:bg-blue-500/5'}"
+1 -1
View File
@@ -12,7 +12,7 @@ import { error } from '@sveltejs/kit'
type InboxFeedType = 'replies' | 'mentions' | 'messages' | 'all' type InboxFeedType = 'replies' | 'mentions' | 'messages' | 'all'
export async function load({ url, fetch }) { export async function load({ url, fetch }) {
if (!profile.data.jwt) error(401) if (!profile.current.jwt) error(401)
const type: InboxFeedType = const type: InboxFeedType =
(url.searchParams.get('type') as InboxFeedType) || 'all' (url.searchParams.get('type') as InboxFeedType) || 'all'
+2 -2
View File
@@ -24,7 +24,7 @@
let loading = $state(false) let loading = $state(false)
async function markAsRead(isRead: boolean) { async function markAsRead(isRead: boolean) {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
loading = true loading = true
@@ -52,7 +52,7 @@
} }
item.read = isRead item.read = isRead
if (profile.data.user) $notifications.inbox += isRead ? -1 : 1 if (profile.current.user) $notifications.inbox += isRead ? -1 : 1
loading = false loading = false
} }
+4 -4
View File
@@ -27,7 +27,7 @@
} }
function getOtherPartyId(message: PrivateMessageView): number { function getOtherPartyId(message: PrivateMessageView): number {
return message.creator.id == profile.data.user?.local_user_view.person.id return message.creator.id == profile.current.user?.local_user_view.person.id
? message.recipient.id ? message.recipient.id
: message.creator.id : message.creator.id
} }
@@ -56,7 +56,7 @@
.filter(c => c.creator.id != c.recipient.id) // you messaged yourself .filter(c => c.creator.id != c.recipient.id) // you messaged yourself
.map(i => ({ .map(i => ({
user: user:
i.creator.id != profile.data.user?.local_user_view.person.id i.creator.id != profile.current.user?.local_user_view.person.id
? i.creator ? i.creator
: i.recipient, : i.recipient,
message: { message: {
@@ -153,8 +153,8 @@
bg-linear-to-r from-slate-700 via-slate-700 to-slate-700/0 dark:from-zinc-300 dark:via-zinc-300 dark:to-zinc-300/0 bg-linear-to-r from-slate-700 via-slate-700 to-slate-700/0 dark:from-zinc-300 dark:via-zinc-300 dark:to-zinc-300/0
text-transparent bg-clip-text flex-1 overflow-hidden" text-transparent bg-clip-text flex-1 overflow-hidden"
> >
{#if preview.message.last_sender == profile.data.user?.local_user_view.person.id} {#if preview.message.last_sender == profile.current.user?.local_user_view.person.id}
{profile.data.user?.local_user_view.person.name}: {profile.current.user?.local_user_view.person.name}:
{/if} {/if}
{preview.message.content} {preview.message.content}
</div> </div>
+1 -1
View File
@@ -2,5 +2,5 @@ import { profile } from '$lib/auth.svelte'
import { error } from '@sveltejs/kit' import { error } from '@sveltejs/kit'
export function load() { export function load() {
if (!profile.data.jwt) error(401) if (!profile.current.jwt) error(401)
} }
+2 -2
View File
@@ -14,7 +14,7 @@ import { error } from '@sveltejs/kit'
type ReportListType = 'unread' | 'all' type ReportListType = 'unread' | 'all'
export async function load({ url, fetch }) { export async function load({ url, fetch }) {
if (!profile.data.jwt) error(401) if (!profile.current.jwt) error(401)
const page = Number(url.searchParams.get('page')) || 1 const page = Number(url.searchParams.get('page')) || 1
const type: ReportListType = const type: ReportListType =
@@ -30,7 +30,7 @@ export async function load({ url, fetch }) {
community_id: community, community_id: community,
} }
const admin = profile.data?.user ? isAdmin(profile!.data.user!) : false const admin = profile.current?.user ? isAdmin(profile!.data.user!) : false
const [posts, comments, messages] = await Promise.all([ const [posts, comments, messages] = await Promise.all([
client.listPostReports({ client.listPostReports({
+1 -1
View File
@@ -24,7 +24,7 @@
let resolving = $state(false) let resolving = $state(false)
async function resolve() { async function resolve() {
if (!profile.data?.jwt || !profile.data.user) return if (!profile.current?.jwt || !profile.current.user) return
resolving = true resolving = true
try { try {
@@ -10,7 +10,7 @@
{$t('nav.communities')} {$t('nav.communities')}
</Header> </Header>
<div class="w-full h-full flex flex-col mt-4"> <div class="w-full h-full flex flex-col mt-4">
{#if !profile.data.user} {#if !profile.current.user}
<div class="mx-auto my-auto"> <div class="mx-auto my-auto">
<Spinner width={24} /> <Spinner width={24} />
</div> </div>
@@ -20,7 +20,7 @@
rounding="2xl" rounding="2xl"
class="flex flex-col dark:bg-zinc-950 max-h-[32rem] overflow-auto" class="flex flex-col dark:bg-zinc-950 max-h-[32rem] overflow-auto"
> >
{#each profile.data.user.moderates as moderate} {#each profile.current.user.moderates as moderate}
{@const community = moderate.community} {@const community = moderate.community}
<div <div
class="-mx-4 px-4 hover:bg-slate-100 hover:dark:bg-zinc-900 transition-colors duration-75" class="-mx-4 px-4 hover:bg-slate-100 hover:dark:bg-zinc-900 transition-colors duration-75"
+3 -3
View File
@@ -206,7 +206,7 @@
<UserAutocomplete <UserAutocomplete
instance={page.url.searchParams.get('instance') || undefined} instance={page.url.searchParams.get('instance') || undefined}
placeholder="Filter by user" placeholder="Filter by user"
jwt={profile.data?.jwt} jwt={profile.current?.jwt}
listing_type="All" listing_type="All"
showWhenEmpty={true} showWhenEmpty={true}
class="flex-1" class="flex-1"
@@ -217,10 +217,10 @@
onselect={e => onselect={e =>
searchParam(page.url, 'user', e?.id.toString() ?? '', 'page')} searchParam(page.url, 'user', e?.id.toString() ?? '', 'page')}
/> />
{#if profile.data?.user && isAdmin(profile.data?.user)} {#if profile.current?.user && isAdmin(profile.current?.user)}
<UserAutocomplete <UserAutocomplete
placeholder="Filter by moderator" placeholder="Filter by moderator"
jwt={profile.data?.jwt} jwt={profile.current?.jwt}
listing_type="All" listing_type="All"
showWhenEmpty={true} showWhenEmpty={true}
class="flex-1" class="flex-1"
+1 -1
View File
@@ -7,7 +7,7 @@ export function load({ params }) {
redirect( redirect(
302, 302,
resolveRoute(`/post/[instance]/[id]`, { resolveRoute(`/post/[instance]/[id]`, {
instance: profile.data.instance.toLowerCase(), instance: profile.current.instance.toLowerCase(),
id: params.instance, id: params.instance,
}), }),
) )
@@ -37,7 +37,7 @@
onMount(async () => { onMount(async () => {
if ( if (
!(data.post.value.post_view.read && settings.markPostsAsRead) && !(data.post.value.post_view.read && settings.markPostsAsRead) &&
profile.data?.jwt profile.current?.jwt
) { ) {
getClient().markPostAsRead({ getClient().markPostAsRead({
read: settings.markPostsAsRead, read: settings.markPostsAsRead,
@@ -28,7 +28,7 @@ function buildContext(thread?: string) {
} }
export async function load({ params, url, fetch }) { export async function load({ params, url, fetch }) {
if (profile.data.instance != params.instance) if (profile.current.instance != params.instance)
redirect(302, resolveRoute('/post/[instance]/[id]/confirm', params)) redirect(302, resolveRoute('/post/[instance]/[id]/confirm', params))
// TODO use Lemmy profile default settings // TODO use Lemmy profile default settings
@@ -51,7 +51,7 @@
}) })
</script> </script>
{#if profile.data?.jwt} {#if profile.current?.jwt}
{#if !commenting} {#if !commenting}
<EndPlaceholder> <EndPlaceholder>
<Button <Button
@@ -60,8 +60,8 @@
disabled={(post.post_view.post.locked || disabled={(post.post_view.post.locked ||
post.post_view.banned_from_community) && post.post_view.banned_from_community) &&
!( !(
profile.data?.user?.local_user_view.local_user.admin || profile.current?.user?.local_user_view.local_user.admin ||
profile.data?.user?.moderates profile.current?.user?.moderates
.map(c => c.community.id) .map(c => c.community.id)
.includes(post.community_view.community.id) .includes(post.community_view.community.id)
)} )}
@@ -119,7 +119,7 @@
{/if} {/if}
{/if} {/if}
{#if commenting || !profile.data.jwt} {#if commenting || !profile.current.jwt}
<div class="gap-2 flex items-center"> <div class="gap-2 flex items-center">
<Select <Select
size="md" size="md"
@@ -15,7 +15,7 @@
import { Plus } from 'svelte-hero-icons' import { Plus } from 'svelte-hero-icons'
let loading = $state(false) let loading = $state(false)
const fetched = $state.snapshot(profile.data.instance) const fetched = $state.snapshot(profile.current.instance)
async function fetchOnHome() { async function fetchOnHome() {
loading = true loading = true
@@ -27,7 +27,7 @@
if (res.post) { if (res.post) {
goto( goto(
resolveRoute(`/post/[instance]/[id]`, { resolveRoute(`/post/[instance]/[id]`, {
instance: profile.data.instance, instance: profile.current.instance,
id: res.post.post.id.toString(), id: res.post.post.id.toString(),
}), }),
) )
@@ -56,7 +56,7 @@
</p> </p>
</header> </header>
<div class="flex flex-row items-center gap-2 flex-wrap"> <div class="flex flex-row items-center gap-2 flex-wrap">
{#if profile.data.jwt} {#if profile.current.jwt}
<Button <Button
{loading} {loading}
disabled={loading} disabled={loading}
@@ -2,6 +2,6 @@ import { profile } from '$lib/auth.svelte.js'
import { redirect } from '@sveltejs/kit' import { redirect } from '@sveltejs/kit'
export async function load({ params }) { export async function load({ params }) {
if (profile.data.instance == params.instance) if (profile.current.instance == params.instance)
redirect(302, `/post/${params.instance}/${params.id}`) redirect(302, `/post/${params.instance}/${params.id}`)
} }
@@ -30,7 +30,7 @@
let data = $state(pageData) let data = $state(pageData)
async function unblockUser(item: PersonBlockView) { async function unblockUser(item: PersonBlockView) {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
data.person_blocks.splice( data.person_blocks.splice(
data.person_blocks.findIndex(i => i.target.id == item.target.id), data.person_blocks.findIndex(i => i.target.id == item.target.id),
@@ -46,7 +46,7 @@
} }
async function unblockCommunity(item: CommunityBlockView) { async function unblockCommunity(item: CommunityBlockView) {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
data.community_blocks.splice( data.community_blocks.splice(
data.community_blocks.findIndex(i => i.community.id == item.community.id), data.community_blocks.findIndex(i => i.community.id == item.community.id),
@@ -63,7 +63,7 @@
} }
async function unblockInstances(item: InstanceBlockView) { async function unblockInstances(item: InstanceBlockView) {
if (!profile.data?.jwt) return if (!profile.current?.jwt) return
if (!data.my_user?.instance_blocks) return if (!data.my_user?.instance_blocks) return
data.my_user.instance_blocks.splice( data.my_user.instance_blocks.splice(
@@ -21,8 +21,8 @@
old_password: oldPassword, old_password: oldPassword,
}) })
if (res?.jwt) { if (res?.jwt) {
const { instance, username } = profile.data const { instance, username } = profile.current
deleteProfile(profile.data.id) deleteProfile(profile.current.id)
await setUser(res.jwt, instance, username!) await setUser(res.jwt, instance, username!)
toast({ content: $t('toast.loginRefresh'), type: 'success' }) toast({ content: $t('toast.loginRefresh'), type: 'success' })
@@ -41,7 +41,7 @@
let bannerImage: FileList | undefined = $state() let bannerImage: FileList | undefined = $state()
async function save() { async function save() {
if (!formData || !profile.data?.jwt) return if (!formData || !profile.current?.jwt) return
loading = true loading = true
@@ -49,16 +49,16 @@
let pfp = profileImage let pfp = profileImage
? await uploadImage( ? await uploadImage(
profileImage[0], profileImage[0],
profile.data.instance, profile.current.instance,
profile.data.jwt, profile.current.jwt,
) )
: undefined : undefined
let banner = bannerImage let banner = bannerImage
? await uploadImage( ? await uploadImage(
bannerImage[0], bannerImage[0],
profile.data.instance, profile.current.instance,
profile.data.jwt, profile.current.jwt,
) )
: undefined : undefined
+4 -3
View File
@@ -6,11 +6,12 @@ import { error } from '@sveltejs/kit'
export const ssr = false export const ssr = false
export async function load({ fetch }) { export async function load({ fetch }) {
if (!profile.data.jwt) error(401) if (!profile.current.jwt) error(401)
const my_user = const my_user =
// profile.data?.user ?? // profile.current?.user ??
(await client({ auth: profile.data?.jwt, func: fetch }).getSite()).my_user (await client({ auth: profile.current?.jwt, func: fetch }).getSite())
.my_user
return { return {
my_user: my_user, my_user: my_user,
+1 -1
View File
@@ -3,7 +3,7 @@ import { client } from '$lib/lemmy.svelte.js'
import { ReactiveState } from '$lib/promise.svelte.js' import { ReactiveState } from '$lib/promise.svelte.js'
export async function load({ fetch, url }) { export async function load({ fetch, url }) {
const { jwt } = profile.data const { jwt } = profile.current
const page = Number(url.searchParams.get('page')) || 1 const page = Number(url.searchParams.get('page')) || 1
+1 -1
View File
@@ -12,7 +12,7 @@ function getSavedItemPublished(item: PostView | CommentView) {
} }
export async function load({ url, fetch }) { export async function load({ url, fetch }) {
if (!profile.data.jwt) throw error(401) if (!profile.current.jwt) throw error(401)
const page = Number(url.searchParams.get('page')) || 1 const page = Number(url.searchParams.get('page')) || 1
const type: 'comments' | 'posts' | 'all' = const type: 'comments' | 'posts' | 'all' =
+1 -1
View File
@@ -96,7 +96,7 @@
> >
<ObjectAutocomplete <ObjectAutocomplete
label={$t('nav.create.community')} label={$t('nav.create.community')}
jwt={profile.data?.jwt} jwt={profile.current?.jwt}
listing_type="All" listing_type="All"
showWhenEmpty={true} showWhenEmpty={true}
onselect={c => onselect={c =>
+1 -1
View File
@@ -50,7 +50,7 @@ export async function load({ url, fetch }) {
})!, })!,
results: new ReactiveState(everything), results: new ReactiveState(everything),
streamed: { streamed: {
object: profile.data?.jwt object: profile.current?.jwt
? getClient(undefined, fetch).resolveObject({ ? getClient(undefined, fetch).resolveObject({
q: query, q: query,
}) })
+1 -1
View File
@@ -208,7 +208,7 @@
class="flex flex-col *:py-2 divide-y divide-slate-200 dark:divide-zinc-800" class="flex flex-col *:py-2 divide-y divide-slate-200 dark:divide-zinc-800"
style="scroll-behavior: smooth;" style="scroll-behavior: smooth;"
> >
{#if profile.data?.jwt} {#if profile.current?.jwt}
<Section open={false} id="account" title={$t('settings.account.title')}> <Section open={false} id="account" title={$t('settings.account.title')}>
<div> <div>
<Button <Button
+7 -7
View File
@@ -55,11 +55,11 @@
let sortForm = $state<HTMLFormElement>() let sortForm = $state<HTMLFormElement>()
async function blockUser(block: number) { async function blockUser(block: number) {
if (!profile.data?.user || !profile.data?.jwt) if (!profile.current?.user || !profile.current?.jwt)
throw new Error('Unauthenticated') throw new Error('Unauthenticated')
try { try {
const blocked = isBlocked(profile.data.user, block) const blocked = isBlocked(profile.current.user, block)
await getClient().blockPerson({ await getClient().blockPerson({
block: !blocked, block: !blocked,
@@ -67,10 +67,10 @@
}) })
if (blocked) { if (blocked) {
const index = profile.data.user.person_blocks const index = profile.current.user.person_blocks
.map(p => p.target.id) .map(p => p.target.id)
.indexOf(block) .indexOf(block)
profile.data.user.person_blocks.splice(index, 1) profile.current.user.person_blocks.splice(index, 1)
} }
toast({ toast({
@@ -210,7 +210,7 @@
</Expandable> </Expandable>
{/if} {/if}
{#snippet actions()} {#snippet actions()}
{#if profile.data?.user && profile.data.jwt && data.person_view.value.person.id != profile.data.user.local_user_view.person.id} {#if profile.current?.user && profile.current.jwt && data.person_view.value.person.id != profile.current.user.local_user_view.person.id}
<div class="flex items-center gap-2 w-full flex-wrap"> <div class="flex items-center gap-2 w-full flex-wrap">
<Button <Button
size="sm" size="sm"
@@ -237,7 +237,7 @@
{$t('form.profile.matrix')} {$t('form.profile.matrix')}
</Button> </Button>
{/if} {/if}
{#if isAdmin(profile.data?.user)} {#if isAdmin(profile.current?.user)}
<Menu class="ml-auto" placement="bottom-end"> <Menu class="ml-auto" placement="bottom-end">
{#snippet target()} {#snippet target()}
<Button size="sm" rounding="pill"> <Button size="sm" rounding="pill">
@@ -292,7 +292,7 @@
<Icon mini size="16" src={NoSymbol} /> <Icon mini size="16" src={NoSymbol} />
{/snippet} {/snippet}
{isBlocked( {isBlocked(
profile.data.user, profile.current.user,
data.person_view.value.person.id, data.person_view.value.person.id,
) )
? 'Unblock' ? 'Unblock'
+1 -1
View File
@@ -26,7 +26,7 @@
style="rotate: -5deg; transition: rotate 1s linear;" style="rotate: -5deg; transition: rotate 1s linear;"
> >
<div class="bg-black/20 font-mono fixed left-1/2 -translate-x-1/2"> <div class="bg-black/20 font-mono fixed left-1/2 -translate-x-1/2">
<p>{profile.data.username ?? 'You'} was slain by Command Palette</p> <p>{profile.current.username ?? 'You'} was slain by Command Palette</p>
</div> </div>
<img <img
src="/other/mc.png" src="/other/mc.png"