Skip to content

Commit

Permalink
(fix) disable send message if file is loading
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine92190 committed Dec 4, 2021
1 parent 593f043 commit dfa3834
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/lib/Room/Room.vue
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@
@click="sendMessage"
>
<slot name="send-icon">
<svg-icon name="send" :param="isMessageEmpty ? 'disabled' : ''" />
<svg-icon
name="send"
:param="isMessageEmpty || isFileLoading ? 'disabled' : ''"
/>
</slot>
</div>
</div>
Expand Down Expand Up @@ -468,6 +471,9 @@ export default {
isMessageEmpty() {
return !this.files.length && !this.message.trim()
},
isFileLoading() {
return this.files.some(e => e.loading)
},
recordedTime() {
return new Date(this.recorder.duration * 1000).toISOString().substr(14, 5)
},
Expand Down Expand Up @@ -964,6 +970,8 @@ export default {
if (!this.files.length && !message) return
if (this.isFileLoading) return
this.selectedUsersTag.forEach(user => {
message = message.replace(
`@${user.username}`,
Expand Down

0 comments on commit dfa3834

Please sign in to comment.