File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
src/content/datachannel/basic/js Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -150,15 +150,12 @@ function onReceiveMessageCallback(event) {
150
150
function onSendChannelStateChange ( ) {
151
151
const readyState = sendChannel . readyState ;
152
152
console . log ( 'Send channel state is: ' + readyState ) ;
153
- if ( readyState === 'open' ) {
154
- dataChannelSend . disabled = false ;
153
+ const closed = readyState !== 'open'
154
+ dataChannelSend . disabled = closed ;
155
+ sendButton . disabled = closed ;
156
+ closeButton . disabled = closed ;
157
+ if ( ! closed ) {
155
158
dataChannelSend . focus ( ) ;
156
- sendButton . disabled = false ;
157
- closeButton . disabled = false ;
158
- } else {
159
- dataChannelSend . disabled = true ;
160
- sendButton . disabled = true ;
161
- closeButton . disabled = true ;
162
159
}
163
160
}
164
161
You can’t perform that action at this time.
0 commit comments