fix: remove default values from text inputs

This commit is contained in:
James Xylight committed 2025-02-05 21:10:17 -08:00
1 parent bd09390fba
commit 714cb37a6e
5 files changed
+22 -11

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@
let {
defaultValue = false,
checked = $bindable(defaultValue),
checked = $bindable(),
labelClass = '',
class: clazz = '',
children,
+1 -1
View File
@@ -49,7 +49,7 @@
let {
label = undefined,
value = $bindable(''),
value = $bindable(),
placeholder = '',
disabled = false,
required = false,
+12 -4
View File
@@ -82,19 +82,27 @@
>
<Header pageHeader>{$t('routes.admin.config.title')}</Header>
{#if formData}
<TextInput bind:value={formData.name} label={$t('form.name')} />
<TextInput
bind:value={formData.description}
bind:value={() => formData.name ?? '', (v) => (formData.description = v)}
label={$t('form.name')}
/>
<TextInput
bind:value={
() => formData.description ?? '', (v) => (formData.description = v)
}
label={$t('form.description')}
/>
<MarkdownEditor
previewButton
bind:value={formData.sidebar}
bind:value={() => formData.sidebar ?? '', (v) => (formData.sidebar = v)}
label={$t('routes.admin.config.sidebar')}
/>
<MarkdownEditor
previewButton
bind:value={formData.legal_information}
bind:value={
() => formData.legal_information ?? '',
(v) => (formData.legal_information = v)
}
label={$t('routes.legal.title')}
/>
<div class="flex flex-col gap-1">
@@ -434,9 +434,12 @@
<CommentForm
postId={data.post.post_view.post.id}
oncomment={(comment) => {
comments.comments.push(comment.comment_view)
reloadComments()
toast({ content: $t('routes.post.commented'), type: 'success' })
Promise.resolve(data.comments).then((r) => {
r.comments.push(comment.comment_view)
})
// comments.comments.push(comment.comment_view)
// reloadComments()
// toast({ content: $t('routes.post.commented'), type: 'success' })
}}
locked={(data.post.post_view.post.locked &&
!(
+2 -2
View File
@@ -33,7 +33,7 @@
let email: string | undefined = $state('')
run(() => {
$effect(() => {
if (email == '') email = undefined
})
@@ -42,7 +42,7 @@
passwordVerify = $state(''),
captcha: GetCaptchaResponse | null = $state(null),
verifyCaptcha: string | undefined = $state(undefined),
application: string | undefined = $state(undefined),
application: string = $state(''),
submitting: boolean = $state(false),
honeypot: string | undefined = $state(undefined),
nsfw: boolean = $state(false)