mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
fix: 🐛 Prevent sending a post without content
This commit is contained in:
parent
fab1757d8f
commit
5a97f12782
|
|
@ -45,7 +45,8 @@
|
||||||
<ComposerButton title="Add content warning" @click="cw = !cw" :toggled="cw">
|
<ComposerButton title="Add content warning" @click="cw = !cw" :toggled="cw">
|
||||||
<iconify-icon width="1.25rem" height="1.25rem" icon="tabler:rating-18-plus" aria-hidden="true" />
|
<iconify-icon width="1.25rem" height="1.25rem" icon="tabler:rating-18-plus" aria-hidden="true" />
|
||||||
</ComposerButton>
|
</ComposerButton>
|
||||||
<ButtonsPrimary :loading="loading" @click="send" class="ml-auto rounded-full">
|
<ButtonsPrimary :loading="loading" @click="send" class="ml-auto rounded-full"
|
||||||
|
:disabled="!canSubmit || loading">
|
||||||
<span>Send!</span>
|
<span>Send!</span>
|
||||||
</ButtonsPrimary>
|
</ButtonsPrimary>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -173,6 +174,11 @@ const props = defineProps<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
const canSubmit = computed(
|
||||||
|
() =>
|
||||||
|
(content.value?.trim().length > 0 || files.value.length > 0) &&
|
||||||
|
content.value?.trim().length <= characterLimit.value,
|
||||||
|
);
|
||||||
const tokenData = useTokenData();
|
const tokenData = useTokenData();
|
||||||
const client = useMegalodon(tokenData);
|
const client = useMegalodon(tokenData);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue