design: make disabled buttons not look like buns
This commit is contained in:
6 files changed
+21
-19
No files matched your search
@@ -19,9 +19,9 @@
|
||||
old_password: oldPassword,
|
||||
})
|
||||
if (res?.jwt) {
|
||||
const { instance } = profile.current
|
||||
const { instance, client } = profile.current
|
||||
profile.remove(profile.current.id)
|
||||
await profile.add(res.jwt, instance)
|
||||
await profile.add(res.jwt, instance, client)
|
||||
|
||||
toast({ content: $t('toast.loginRefresh'), type: 'success' })
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { navigating, page } from '$app/state'
|
||||
import { client } from '$lib/api/client.svelte'
|
||||
import { profile } from '$lib/app/auth.svelte'
|
||||
import { t } from '$lib/app/i18n'
|
||||
import { searchParam } from '$lib/app/util.svelte'
|
||||
import CommentItem from '$lib/feature/comment/CommentItem.svelte'
|
||||
@@ -103,7 +102,6 @@
|
||||
>
|
||||
<ObjectAutocomplete
|
||||
label={$t('nav.create.community')}
|
||||
jwt={profile.current?.jwt}
|
||||
listing_type="All"
|
||||
showWhenEmpty={true}
|
||||
onselect={(c) =>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/state'
|
||||
import type { ClientType } from '$lib/api/base.js'
|
||||
import { getClient } from '$lib/api/client.svelte'
|
||||
import type { GetCaptchaResponse } from '$lib/api/types'
|
||||
import { profile } from '$lib/app/auth.svelte'
|
||||
@@ -51,13 +52,15 @@
|
||||
let username = $state(''),
|
||||
password = $state(''),
|
||||
passwordVerify = $state(''),
|
||||
captcha: GetCaptchaResponse | null = $state(null),
|
||||
verifyCaptcha: string | undefined = $state(undefined),
|
||||
application: string = $state(''),
|
||||
submitting: boolean = $state(false),
|
||||
honeypot: string | undefined = $state(undefined),
|
||||
nsfw: boolean = $state(false),
|
||||
verifying: boolean = $state(false)
|
||||
captcha = $state<GetCaptchaResponse>(),
|
||||
verifyCaptcha = $state<string>(),
|
||||
application = $state(''),
|
||||
submitting = $state(false),
|
||||
honeypot = $state<string>(),
|
||||
nsfw = $state(false),
|
||||
verifying = $state(false)
|
||||
|
||||
const instanceType: ClientType = $state({ name: 'lemmy', baseUrl: '/api/v3' })
|
||||
|
||||
const getCaptcha = async () =>
|
||||
(captcha = await getClient(instance, fetch).getCaptcha())
|
||||
@@ -86,7 +89,7 @@
|
||||
const registrationMode = data.site_view.local_site.registration_mode
|
||||
|
||||
if (res?.jwt) {
|
||||
await profile.add(res.jwt, page.params.instance)
|
||||
await profile.add(res.jwt, page.params.instance!, instanceType)
|
||||
|
||||
toast({ content: $t('toast.logIn'), type: 'success' })
|
||||
goto('/')
|
||||
@@ -125,7 +128,7 @@
|
||||
})
|
||||
|
||||
if (res.jwt) {
|
||||
await profile.add(res.jwt, page.params.instance)
|
||||
await profile.add(res.jwt, data.instance, instanceType)
|
||||
goto('/')
|
||||
} else if (res.verify_email_sent) {
|
||||
pushError({
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { getClient } from '$lib/api/client.svelte'
|
||||
import { client } from '$lib/api/client.svelte'
|
||||
import { SvelteURL } from 'svelte/reactivity'
|
||||
|
||||
export async function load({ params, fetch }) {
|
||||
const site = await getClient(params.instance, fetch).getSite()
|
||||
const site = await client({ instanceURL: params.instance, func: fetch}).getSite()
|
||||
|
||||
return site
|
||||
return {...site, instance: new SvelteURL(site.site_view.site.actor_id).hostname}
|
||||
}
|
||||
Reference in new issue
Block a user