Fix focusing on topic when using ctx menu Edit Topic action

This commit is contained in:
Max Leiter 2022-05-31 20:47:50 -07:00
parent 73014369c4
commit 5b4166ff30
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA
3 changed files with 11 additions and 10 deletions

View file

@ -236,14 +236,16 @@ export default defineComponent({
} }
); );
const editTopicRef = ref(props.channel.editTopic); watch(
watch(editTopicRef, (newTopic) => { () => props.channel.editTopic,
if (newTopic) { (newTopic) => {
void nextTick(() => { if (newTopic) {
topicInput.value?.focus(); void nextTick(() => {
}); topicInput.value?.focus();
});
}
} }
}); );
onMounted(() => { onMounted(() => {
channelChanged(); channelChanged();
@ -260,7 +262,6 @@ export default defineComponent({
messageList, messageList,
topicInput, topicInput,
specialComponent, specialComponent,
editTopicRef,
hideUserVisibleError, hideUserVisibleError,
editTopic, editTopic,
saveTopic, saveTopic,

View file

@ -6,7 +6,7 @@
<i class="account"> [{{ message.account }}]</i> <i class="account"> [{{ message.account }}]</i>
</template> </template>
<template v-if="message.gecos"> <template v-if="message.gecos">
<i class="realname"> {{ message.gecos }} </i> <i class="realname"> {{ message.gecos }}</i>
</template> </template>
has joined the channel has joined the channel
</span> </span>

View file

@ -2,7 +2,7 @@ import socket from "../socket";
import {store} from "../store"; import {store} from "../store";
import {switchToChannel} from "../router"; import {switchToChannel} from "../router";
function input(args) { function input(args: string[]) {
if (args.length > 0) { if (args.length > 0) {
let channels = args[0]; let channels = args[0];