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

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