浏览代码

Check for version updates on every conversation change

Danilo Bargen 8 年之前
父节点
当前提交
4ebf009289
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      src/partials/messenger.ts

+ 8 - 3
src/partials/messenger.ts

@@ -28,6 +28,7 @@ import {NotificationService} from '../services/notification';
 import {ReceiverService} from '../services/receiver';
 import {SettingsService} from '../services/settings';
 import {StateService} from '../services/state';
+import {VersionService} from '../services/version';
 import {WebClientService} from '../services/webclient';
 import {ControllerModelMode} from '../types/enums';
 
@@ -208,7 +209,7 @@ class ConversationController {
     public static $inject = [
         '$stateParams', '$state', '$timeout', '$log', '$scope', '$rootScope',
         '$mdDialog', '$mdToast', '$location', '$translate',
-        'WebClientService', 'StateService', 'ReceiverService', 'MimeService',
+        'WebClientService', 'StateService', 'ReceiverService', 'MimeService', 'VersionService',
     ];
     constructor($stateParams: threema.ConversationStateParams,
                 $state: ng.ui.IStateService,
@@ -223,7 +224,8 @@ class ConversationController {
                 webClientService: WebClientService,
                 stateService: StateService,
                 receiverService: ReceiverService,
-                mimeService: MimeService) {
+                mimeService: MimeService,
+                versionService: VersionService) {
         this.$stateParams = $stateParams;
         this.$timeout = $timeout;
         this.$log = $log;
@@ -249,6 +251,9 @@ class ConversationController {
         // replace with transition hooks.
         $rootScope.$on('$stateChangeStart', () => this.$mdDialog.cancel());
 
+        // Check for version updates
+        versionService.checkForUpdate();
+
         // Redirect to welcome if necessary
         if (stateService.state === 'error') {
             $log.debug('ConversationController: WebClient not yet running, redirecting to welcome screen');
@@ -909,7 +914,7 @@ class ReceiverDetailController {
 
         this.receiver = webClientService.receivers.getData($stateParams);
 
-        // append members
+        // Append members
         if (this.receiver.type === 'contact') {
             let contactReceiver = (<threema.ContactReceiver> this.receiver);