Show character limit in compose
This commit is contained in:
parent
285d66eddf
commit
4894ded6a5
|
@ -92,7 +92,7 @@
|
||||||
<el-button link size="default" @click="cw = !cw"> CW </el-button>
|
<el-button link size="default" @click="cw = !cw"> CW </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
<div class="actions-group">
|
<div class="actions-group">
|
||||||
<span>500</span>
|
<span>{{ statusChars }}</span>
|
||||||
<el-button type="primary" @click="post" :loading="loading"> {{ $t('modals.new_toot.toot') }} </el-button>
|
<el-button type="primary" @click="post" :loading="loading"> {{ $t('modals.new_toot.toot') }} </el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -204,6 +204,9 @@ export default defineComponent({
|
||||||
const dropTarget = ref<any>(null)
|
const dropTarget = ref<any>(null)
|
||||||
const droppableVisible = ref<boolean>(false)
|
const droppableVisible = ref<boolean>(false)
|
||||||
|
|
||||||
|
const maxStatusChars = ref<number>(500)
|
||||||
|
const statusChars = computed(() => maxStatusChars.value - (form.status.length + form.spoiler.length))
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const [a, s]: [LocalAccount, LocalServer] = await win.ipcRenderer.invoke('get-local-account', id.value)
|
const [a, s]: [LocalAccount, LocalServer] = await win.ipcRenderer.invoke('get-local-account', id.value)
|
||||||
const c = generator(s.sns, s.baseURL, a.accessToken, userAgent.value)
|
const c = generator(s.sns, s.baseURL, a.accessToken, userAgent.value)
|
||||||
|
@ -215,6 +218,11 @@ export default defineComponent({
|
||||||
nsfw.value = credentials.data.source.sensitive
|
nsfw.value = credentials.data.source.sensitive
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const instance = await c.getInstance()
|
||||||
|
if (instance.data.max_toot_chars) {
|
||||||
|
maxStatusChars.value = instance.data.max_toot_chars
|
||||||
|
}
|
||||||
|
|
||||||
const emojis = await c.getInstanceCustomEmojis()
|
const emojis = await c.getInstanceCustomEmojis()
|
||||||
const customEmojis = emojis.data
|
const customEmojis = emojis.data
|
||||||
.map(emoji => {
|
.map(emoji => {
|
||||||
|
@ -442,7 +450,8 @@ export default defineComponent({
|
||||||
removePollOption,
|
removePollOption,
|
||||||
droppableVisible,
|
droppableVisible,
|
||||||
inReplyTo,
|
inReplyTo,
|
||||||
clearReply
|
clearReply,
|
||||||
|
statusChars
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
import mitt from 'mitt'
|
|
||||||
|
|
||||||
export const EventEmitter = mitt()
|
|
Loading…
Reference in New Issue