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