misc: add message when signing up for registration apps

This commit is contained in:
Xyphyn committed 2023-10-14 11:35:24 -07:00
1 parent 108169f5a9
commit 9d8b143964
3 files changed
+28 -14

No files matched your search

+2 -2
View File
@@ -117,7 +117,7 @@
<Icon src={ServerStack} mini size="18" slot="prefix" />
<span class="hidden md:inline">Admin</span>
{#if $profile?.user?.notifications.applications ?? 0 > 0}
{#if ($profile?.user?.notifications.applications ?? 0) > 0}
<div
class="rounded-full w-2 h-2 bg-red-500 absolute -top-1 -left-1"
/>
@@ -130,7 +130,7 @@
aria-label="Moderation"
class="max-md:w-9 max-md:h-8 max-md:!p-0 dark:text-zinc-300 text-slate-700 relative"
>
{#if $profile?.user?.notifications.reports ?? 0 > 0}
{#if ($profile?.user?.notifications.reports ?? 0) > 0}
<div
class="rounded-full w-2 h-2 bg-red-500 absolute -top-1 -left-1"
/>
+1 -1
View File
@@ -6,7 +6,7 @@
import { Badge } from 'mono-svelte'
</script>
{#if $profile?.user?.notifications.applications ?? 0 > 0}
{#if ($profile?.user?.notifications.applications ?? 0) > 0}
<span class="flex flex-row text-red-500 gap-2">
<Badge color="red-subtle" class="w-max">
{$profile?.user?.notifications.applications}
+25 -11
View File
@@ -64,27 +64,41 @@
honeypot,
})
toast({
content: 'Signed up.',
type: 'success',
})
if (res?.jwt) {
await setUser(res.jwt, $page.params.instance, username)
toast({ content: 'Successfully logged in.', type: 'success' })
goto('/')
} else if (res.verify_email_sent) {
} else if (
res.verify_email_sent ||
data.site_view.local_site.registration_mode == 'RequireApplication'
) {
currentInstance.set(instance)
toast({
content:
'A verification link was sent to your email. Verify your email, and then you can log in.',
type: 'info',
})
if (res.verify_email_sent) {
toast({
content:
'A verification link was sent to your email. Verify your email, and then you can log in.',
type: 'info',
})
}
if (
data.site_view.local_site.registration_mode == 'RequireApplication'
) {
toast({
content:
'Please wait for your registration application to be approved before you can log in.',
type: 'info',
})
}
goto('/')
} else {
throw new Error('Failed to sign up.')
}
toast({
content: 'Signed up.',
type: 'success',
})
} catch (err) {
toast({
content: err as any,