File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 6767 Open connection
6868 </button >
6969 <button
70- :disabled =" !msgSend "
70+ :disabled =" isSendDisabled "
7171 class =" btn btn-blue"
72- :class =" { 'cursor-not-allowed opacity-50': !msgSend }"
72+ :class =" { 'cursor-not-allowed opacity-50': isSendDisabled }"
7373 @click.prevent =" sendMessage"
7474 >
7575 Send message
@@ -105,6 +105,9 @@ export default {
105105 closed: ' Connection closed!'
106106 }
107107 return statusMap[this .connectionStatus ]
108+ },
109+ isSendDisabled () {
110+ return ! this .msgSend || this .connectionStatus === ' closed'
108111 }
109112 },
110113 mounted () {
@@ -120,7 +123,7 @@ export default {
120123 this .toggleProperties ()
121124 },
122125 closeConnection () {
123- this .$socketManager .close ()
126+ this .$socketManager .close (1000 )
124127 this .toggleProperties (false )
125128 this .msgSend = ' '
126129 this .msgReceived = ' '
You can’t perform that action at this time.
0 commit comments