소스 검색

Fix closing of chat when deleting conversation

Danilo Bargen 7 년 전
부모
커밋
5d8c2a4320
3개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 3
      src/partials/messenger.ts
  2. 1 1
      src/services/webclient.ts
  3. 1 1
      src/threema.d.ts

+ 5 - 3
src/partials/messenger.ts

@@ -1021,6 +1021,8 @@ class NavigationController {
 }
 
 class MessengerController {
+    private logTag: string = '[MessengerController]';
+
     public name = 'messenger';
     private receiverService: ReceiverService;
     private $state;
@@ -1036,7 +1038,7 @@ class MessengerController {
                 webClientService: WebClientService, controllerService: ControllerService) {
         // Redirect to welcome if necessary
         if (stateService.state === 'error') {
-            $log.debug('MessengerController: WebClient not yet running, redirecting to welcome screen');
+            $log.debug(this.logTag, 'MessengerController: WebClient not yet running, redirecting to welcome screen');
             $state.go('welcome');
             return;
         }
@@ -1064,7 +1066,7 @@ class MessengerController {
         }, true);
 
         this.webClientService.setReceiverListener({
-            onRemoved(receiver: threema.Receiver) {
+            onConversationRemoved(receiver: threema.Receiver) {
                 switch ($state.current.name) {
                     case 'messenger.home.conversation':
                     case 'messenger.home.detail':
@@ -1080,7 +1082,7 @@ class MessengerController {
                         }
                         break;
                     default:
-                        $log.warn('Ignored onRemoved event for state', $state.current.name);
+                        $log.debug(this.logTag, 'Ignored onRemoved event for state', $state.current.name);
                 }
             },
         });

+ 1 - 1
src/services/webclient.ts

@@ -2283,7 +2283,7 @@ export class WebClientService {
                 // Call on-removed listener
                 this.receiverListener.forEach((listener: threema.ReceiverListener) => {
                     this.$log.debug(this.logTag, 'Call on removed listener');
-                    listener.onRemoved(data.receiver);
+                    listener.onConversationRemoved(receiver);
                 });
                 break;
             default:

+ 1 - 1
src/threema.d.ts

@@ -622,7 +622,7 @@ declare namespace threema {
     }
 
     interface ReceiverListener {
-        onRemoved(receiver: Receiver);
+        onConversationRemoved(receiver: Receiver);
     }
 
     interface Config {