Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 937d4db

Browse files
committedMar 12, 2021
fewer ui changes, but sending is broken
1 parent 6b66285 commit 937d4db

File tree

7 files changed

+71
-62
lines changed

7 files changed

+71
-62
lines changed
 

‎src/connectClient/WebRtcCommunication.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
234234
// Provide Notice that initial WebRTC connection failed and the fallback method will be used
235235
willAttemptTurn() {
236236

237-
this.uiCommunicator(this.lifeCycle.UsingFallback);
237+
this.uiCommunicator(this.lifeCycle.UsingFallback, this.activeInitiatorId);
238238
if(!this.connected && this.tryingTurn && this.usingVersion === 'V2'){
239239
this.refreshQrTimer();
240240
this.refreshEnabled = false;
@@ -420,11 +420,13 @@ export default class WebRtcCommunication extends MewConnectCommon {
420420

421421
disconnectRTC() {
422422
try {
423-
debugStages('DISCONNECT RTC');
424-
this.connected = false;
425-
this.uiCommunicator(this.lifeCycle.RtcDisconnectEvent);
426-
this.rtcDestroy();
427-
this.instance = null;
423+
if(this.connected){
424+
debugStages('DISCONNECT RTC');
425+
this.connected = false;
426+
this.uiCommunicator(this.lifeCycle.RtcDisconnectEvent);
427+
this.rtcDestroy();
428+
this.instance = null;
429+
}
428430
} catch (e) {
429431
debug(e);
430432
}
@@ -446,6 +448,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
446448
} else {
447449
encryptedSend = await this.mewCrypto.encrypt(JSON.stringify(arg));
448450
}
451+
console.log(this.p); // todo remove dev item
449452
this.p.send(JSON.stringify(encryptedSend));
450453
debug('SENDING RTC');
451454
} else {

‎src/connectClient/initiator/MewConnectInitiatorV2.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
6666
}
6767

6868
this.webRtcCommunication.on(this.lifeCycle.UsingFallback, id => {
69-
debug('USING TURN FALLBACK');
69+
debug('USING TURN FALLBACK', id, this.initiatorId);
7070
if (this.initiatorId === id) {
7171
this.useFallback();
7272
} else {
@@ -558,7 +558,7 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
558558
this.rtcSend(JSON.stringify({ type, data: msg }));
559559
}
560560

561-
/* async rtcSend(arg) {
561+
async rtcSend(arg) {
562562
// if (this.isAlive()) {
563563
// let encryptedSend;
564564
// if (typeof arg === 'string') {
@@ -573,7 +573,7 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
573573
// this.uiCommunicator(this.lifeCycle.attemptedDisconnectedSend);
574574
// return false;
575575
// }
576-
}*/
576+
}
577577

578578
rtcDestroy() {
579579
if (this.active) {

‎src/connectProvider/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,9 @@ export default class Integration extends EventEmitter {
415415
return true;
416416
} catch (e) {
417417
debugErrors('disconnect ERROR');
418-
this.popUpHandler.showNotice(messageConstants.disconnectError);
418+
if(this.popUpHandler){
419+
this.popUpHandler.showNotice(messageConstants.disconnectError);
420+
}
419421
// eslint-disable-next-line
420422
console.error(e);
421423
return false;

‎src/connectWindow/popUpCreator.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,14 @@ export default class PopUpCreator extends EventEmitter{
104104
}
105105

106106
cancelConnectionSetup() {
107-
this.popupWindowOpen = null;
108-
this.hideNotifier();
109-
this.closePopupWindow();
110-
this.windowClosedListener();
107+
try {
108+
this.popupWindowOpen = null;
109+
this.hideNotifier();
110+
this.closePopupWindow();
111+
this.windowClosedListener();
112+
} catch (e) {
113+
console.error(e)
114+
}
111115
}
112116

113117
showQrError() {

‎src/connectWindow/popUpHandler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export default class PopUpHandler {
209209
}
210210

211211
hideNotifier() {
212-
const notify = document.getElementById('Notifications-mew');
212+
const notify = document.getElementById('Notifications');
213213
if (notify) {
214214
notify.className = 'hidden';
215215
}

‎src/connectWindow/popupStyles.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -421,16 +421,16 @@ const connectedNotifierCSS = elementId => {
421421

422422
const WindowInformerCSS = `
423423
424-
div#Notifications-mew.hidden {
424+
div#Notifications.hidden {
425425
visibility: hidden;
426426
}
427427
428-
div#Notifications-mew.shown {
428+
div#Notifications.shown {
429429
visibility: visible;
430430
}
431431
432-
#Notifications-mew,
433-
#Notifications-mew * {
432+
#Notifications,
433+
#Notifications * {
434434
435435
animation: none;
436436
animation-delay: 0;
@@ -585,30 +585,30 @@ const WindowInformerCSS = `
585585
586586
}
587587
588-
#Notifications-mew * {
588+
#Notifications * {
589589
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
590590
Arial, sans-serif;
591591
box-sizing: border-box;
592592
}
593593
594-
#Notifications-mew {
594+
#Notifications {
595595
position: fixed;
596596
top: 0;
597597
right: 0;
598598
text-align: right;
599599
z-index: 2147483647;
600600
}
601601
602-
#Notifications-mew style {
602+
#Notifications style {
603603
display: none;
604604
}
605605
606-
#Notifications-mew .Notification {
606+
#Notifications .Notification {
607607
display: block;
608608
margin: 8px 16px 0 16px;
609609
}
610610
611-
#Notifications-mew .NotificationBox {
611+
#Notifications .NotificationBox {
612612
display: flex;
613613
flex-direction: column;
614614
background-color: #fff;
@@ -625,14 +625,14 @@ const WindowInformerCSS = `
625625
overflow: hidden;
626626
}
627627
628-
#Notifications-mew
628+
#Notifications
629629
.Notificationshow
630630
.NotificationBox {
631631
opacity: 1;
632632
transform: translateX(0);
633633
}
634634
635-
#Notifications-mew .NotificationContent {
635+
#Notifications .NotificationContent {
636636
display: flex;
637637
flex-direction: row;
638638
padding: 8px 8px 8px 16px;
@@ -641,25 +641,25 @@ const WindowInformerCSS = `
641641
cursor: pointer;
642642
}
643643
644-
#Notifications-mew .NotificationMessage {
644+
#Notifications .NotificationMessage {
645645
display: block;
646646
color: black;
647647
line-height: 1.5;
648648
}
649649
650-
#Notifications-mew .NotificationChevron {
650+
#Notifications .NotificationChevron {
651651
display: block;
652652
margin-left: 8px;
653653
transition: transform 0.05s;
654654
}
655655
656-
#Notifications-mew .NotificationProgressBar {
656+
#Notifications .NotificationProgressBar {
657657
display: block;
658658
height: 2px;
659659
position: relative;
660660
}
661661
662-
#Notifications-mew .NotificationProgressBar::before {
662+
#Notifications .NotificationProgressBar::before {
663663
display: block;
664664
position: absolute;
665665
content: "";
@@ -719,41 +719,41 @@ const WindowInformerCSS = `
719719
}
720720
}
721721
722-
#Notifications-mew
722+
#Notifications
723723
.NotificationExpand
724724
.NotificationProgressBar {
725725
margin-bottom: -1px;
726726
}
727727
728-
#Notifications-mew
728+
#Notifications
729729
.NotificationExpand
730730
.NotificationChevron {
731731
transform: rotateZ(180deg);
732732
}
733733
734-
#Notifications-mew .NotificationActions {
734+
#Notifications .NotificationActions {
735735
display: none;
736736
flex-direction: column;
737737
border-top: 1px solid #f5f7f8;
738738
padding: 8px 16px;
739739
}
740740
741-
#Notifications-mew
741+
#Notifications
742742
.NotificationExpand
743743
.NotificationActions {
744744
display: flex;
745745
}
746746
747-
#Notifications-mew .NotificationAction {
747+
#Notifications .NotificationAction {
748748
color: #888;
749749
margin: 8px 0;
750750
}
751751
752-
#Notifications-mew .NotificationButtonInfo {
752+
#Notifications .NotificationButtonInfo {
753753
margin: 0 8px 0 0;
754754
}
755755
756-
#Notifications-mew .NotificationButton {
756+
#Notifications .NotificationButton {
757757
color: #1652f0;
758758
-webkit-text-fill-color: #1652f0;
759759
cursor: pointer;
@@ -764,7 +764,7 @@ const WindowInformerCSS = `
764764
transition: opacity 0.25s;
765765
}
766766
767-
#Notifications-mew .NotificationButton:active {
767+
#Notifications .NotificationButton:active {
768768
opacity: 0.6;
769769
}
770770
`;

‎src/connectWindow/popupWindowDesign.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,11 @@ const noticetext = `
383383
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
384384
385385
386-
div#Notifications-mew.hidden {
386+
div#Notifications.hidden {
387387
visibility: hidden;
388388
}
389389
390-
div#Notifications-mew.hidden {
390+
div#Notifications.hidden {
391391
visibility: hidden;
392392
}
393393
@@ -402,8 +402,8 @@ const noticetext = `
402402
display: none;
403403
}
404404
405-
#Notifications-mew,
406-
#Notifications-mew * {
405+
#Notifications,
406+
#Notifications * {
407407
408408
animation: none;
409409
animation-delay: 0;
@@ -518,30 +518,30 @@ const noticetext = `
518518
519519
}
520520
521-
#Notifications-mew * {
521+
#Notifications * {
522522
font-family: 'Roboto', sans-serif;
523523
font-weight: 500;
524524
box-sizing: border-box;
525525
}
526526
527-
#Notifications-mew {
527+
#Notifications {
528528
position: fixed;
529529
top: 0;
530530
right: 0;
531531
text-align: right;
532532
z-index: 2147483647;
533533
}
534534
535-
#Notifications-mew style {
535+
#Notifications style {
536536
display: none;
537537
}
538538
539-
#Notifications-mew .Notification {
539+
#Notifications .Notification {
540540
display: block;
541541
margin: 8px 16px 0 16px;
542542
}
543543
544-
#Notifications-mew .NotificationBox {
544+
#Notifications .NotificationBox {
545545
display: flex;
546546
flex-direction: column;
547547
background-color: #fff;
@@ -558,14 +558,14 @@ const noticetext = `
558558
overflow: hidden;
559559
}
560560
561-
#Notifications-mew
561+
#Notifications
562562
.Notificationshow
563563
.NotificationBox {
564564
opacity: 1;
565565
transform: translateX(0);
566566
}
567567
568-
#Notifications-mew .NotificationContent {
568+
#Notifications .NotificationContent {
569569
background-color: rgb(249, 250, 251);
570570
display: flex;
571571
flex-direction: row;
@@ -575,25 +575,25 @@ const noticetext = `
575575
cursor: pointer;
576576
}
577577
578-
#Notifications-mew .NotificationMessage {
578+
#Notifications .NotificationMessage {
579579
display: block;
580580
color: black;
581581
line-height: 1.5;
582582
}
583583
584-
#Notifications-mew .NotificationChevron {
584+
#Notifications .NotificationChevron {
585585
display: block;
586586
margin-left: 8px;
587587
transition: transform 0.05s;
588588
}
589589
590-
#Notifications-mew .NotificationProgressBar {
590+
#Notifications .NotificationProgressBar {
591591
display: block;
592592
height: 2px;
593593
position: relative;
594594
}
595595
596-
#Notifications-mew .NotificationProgressBar::before {
596+
#Notifications .NotificationProgressBar::before {
597597
display: block;
598598
position: absolute;
599599
content: "";
@@ -653,41 +653,41 @@ const noticetext = `
653653
}
654654
}
655655
656-
#Notifications-mew
656+
#Notifications
657657
.NotificationExpand
658658
.NotificationProgressBar {
659659
margin-bottom: -1px;
660660
}
661661
662-
#Notifications-mew
662+
#Notifications
663663
.NotificationExpand
664664
.NotificationChevron {
665665
transform: rotateZ(180deg);
666666
}
667667
668-
#Notifications-mew .NotificationActions {
668+
#Notifications .NotificationActions {
669669
display: none;
670670
flex-direction: column;
671671
border-top: 1px solid #f5f7f8;
672672
padding: 8px 16px;
673673
}
674674
675-
#Notifications-mew
675+
#Notifications
676676
.NotificationExpand
677677
.NotificationActions {
678678
display: flex;
679679
}
680680
681-
#Notifications-mew .NotificationAction {
681+
#Notifications .NotificationAction {
682682
color: #888;
683683
margin: 8px 0;
684684
}
685685
686-
#Notifications-mew .NotificationButtonInfo {
686+
#Notifications .NotificationButtonInfo {
687687
margin: 0 8px 0 0;
688688
}
689689
690-
#Notifications-mew .NotificationButton {
690+
#Notifications .NotificationButton {
691691
color: #33c7b0;
692692
-webkit-text-fill-color: #33c7b0;
693693
cursor: pointer;
@@ -698,11 +698,11 @@ const noticetext = `
698698
transition: opacity 0.25s;
699699
}
700700
701-
#Notifications-mew .NotificationButton:active {
701+
#Notifications .NotificationButton:active {
702702
opacity: 0.6;
703703
}
704704
705-
#Notifications-mew .NotificationContent .spaceman-background {
705+
#Notifications .NotificationContent .spaceman-background {
706706
background-color: rgb(249, 250, 251);
707707
border-radius: 10px;
708708
height: 50px;

0 commit comments

Comments
 (0)
Please sign in to comment.