Do not disable input when disconnected

This commit is contained in:
Pavel Djundik 2018-08-15 12:00:54 +03:00 committed by Pavel Djundik
parent 1d4ab8fff1
commit 839b07fdc2

View File

@ -11,11 +11,9 @@
v-model="channel.pendingMessage" v-model="channel.pendingMessage"
:placeholder="getInputPlaceholder(channel)" :placeholder="getInputPlaceholder(channel)"
:aria-label="getInputPlaceholder(channel)" :aria-label="getInputPlaceholder(channel)"
:disabled="!$root.connected"
class="mousetrap" class="mousetrap"
@keypress.enter.exact.prevent="onSubmit" /> @keypress.enter.exact.prevent="onSubmit" />
<span <span
v-if="$root.connected"
id="submit-tooltip" id="submit-tooltip"
class="tooltipped tooltipped-w tooltipped-no-touch" class="tooltipped tooltipped-w tooltipped-no-touch"
aria-label="Send message"> aria-label="Send message">
@ -128,6 +126,10 @@ export default {
// This can only be called from another interactive event (e.g. button click) // This can only be called from another interactive event (e.g. button click)
$(this.$refs.input).trigger("click").trigger("focus"); $(this.$refs.input).trigger("click").trigger("focus");
if (!this.$root.connected) {
return false;
}
const target = this.channel.id; const target = this.channel.id;
const text = this.channel.pendingMessage; const text = this.channel.pendingMessage;