fix: menu buttons not being disabled

This commit is contained in:
Xylight committed 2024-06-03 14:27:20 -07:00
1 parent 23839d0dbc
commit 6a6b25fd97
4 files changed
+6 -4867

No files matched your search

+1 -5
View File
@@ -200,11 +200,7 @@
icon={Plus}
/>
<MenuDivider>Create</MenuDivider>
<MenuButton
link
href="/create/post"
disabled={$profile?.jwt == undefined}
>
<MenuButton link href="/create/post" disabled={!$profile?.jwt}>
<Icon src={PencilSquare} mini width={16} slot="prefix" />
Post
</MenuButton>
+5 -2
View File
@@ -6,10 +6,11 @@
import { DOMAIN_REGEX_FORMS } from '$lib/util'
import { profile, profileData, type Profile } from '$lib/auth'
import { LINKED_INSTANCE_URL } from '$lib/instance'
import { goto } from '$app/navigation'
let form = {
instance: '',
username: 'Guest',
username: `Guest ${$profileData.profiles.filter((p) => p.jwt == undefined).length + 1}`,
loading: false,
}
@@ -37,12 +38,14 @@
return {
profile: id,
profiles: [newProfile, ...pd.profiles],
profiles: [...pd.profiles, newProfile],
}
})
toast({ content: 'Added that account.', type: 'success' })
goto('/')
form.loading = false
}
</script>