Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Ambrosini <marcoambrosini@pm.me>2021-02-10 19:56:49 +0300
committerMarco Ambrosini <marcoambrosini@pm.me>2021-02-16 11:41:31 +0300
commit3748a6b969a0187cb6434ceb3757265f29454445 (patch)
treede0a9ea288e27e42734e116f79eeeead076f9aa0 /src/components/NewMessageForm
parent54c8d9c59b06d5ffef5e130ed20271a70827f4c1 (diff)
Fix conversation switch lag
Signed-off-by: Marco Ambrosini <marcoambrosini@pm.me>
Diffstat (limited to 'src/components/NewMessageForm')
-rw-r--r--src/components/NewMessageForm/NewMessageForm.vue26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/components/NewMessageForm/NewMessageForm.vue b/src/components/NewMessageForm/NewMessageForm.vue
index db372fad0..01e411a3b 100644
--- a/src/components/NewMessageForm/NewMessageForm.vue
+++ b/src/components/NewMessageForm/NewMessageForm.vue
@@ -40,6 +40,7 @@
<div
v-if="canUploadFiles || canShareFiles">
<Actions
+ ref="uploadMenu"
default-icon="icon-clip-add-file"
:aria-label="t('spreed', 'Share files to the conversation')"
:aria-haspopup="true">
@@ -59,11 +60,11 @@
</ActionButton>
</Actions>
</div>
- <div
- v-if="!isReadOnly">
+ <div>
<EmojiPicker @select="addEmoji">
<button
type="button"
+ disabled="disabled"
class="nc-button nc-button__main"
:aria-label="t('spreed', 'Add emoji')"
:aria-haspopup="true">
@@ -86,7 +87,7 @@
ref="advancedInput"
v-model="text"
:token="token"
- :active-input="!isReadOnly"
+ :active-input="!disabled"
:placeholder-text="placeholderText"
:aria-label="placeholderText"
@update:contentEditable="contentEditableToParsed"
@@ -94,7 +95,7 @@
@files-pasted="handlePastedFiles" />
</div>
<button
- :disabled="isReadOnly"
+ :disabled="disabled"
type="submit"
:aria-label="t('spreed', 'Send message')"
class="nc-button nc-button__main"
@@ -175,12 +176,13 @@ export default {
}
},
- isReadOnly() {
+ disabled() {
return this.conversation.readOnly === CONVERSATION.STATE.READ_ONLY
+ || !this.currentConversationIsJoined
},
placeholderText() {
- return this.isReadOnly
+ return this.disabled
? t('spreed', 'This conversation has been locked')
: t('spreed', 'Write message, @ to mention someone …')
},
@@ -194,7 +196,7 @@ export default {
},
canShareFiles() {
- return !this.currentUserIsGuest && !this.isReadOnly
+ return !this.currentUserIsGuest
},
canUploadFiles() {
@@ -207,6 +209,16 @@ export default {
attachmentFolderFreeSpace() {
return this.$store.getters.getAttachmentFolderFreeSpace()
},
+
+ currentConversationIsJoined() {
+ return this.$store.getters.currentConversationIsJoined
+ },
+ },
+
+ watch: {
+ disabled(newValue) {
+ this.$refs.uploadMenu.$refs.menuButton.disabled = newValue
+ },
},
mounted() {