From 70cae4135f5d12315e5ea3e435ebb0a55da8c61a Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Tue, 20 May 2014 11:05:18 -0300 Subject: [PATCH] Ask for enable html5 notification on chrome --- js/controllers/header.js | 1 - js/services/controllerUtils.js | 5 ++++- js/services/notifications.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/controllers/header.js b/js/controllers/header.js index 4d43919ef..c741a8a9d 100644 --- a/js/controllers/header.js +++ b/js/controllers/header.js @@ -23,7 +23,6 @@ angular.module('copay.header').controller('HeaderController', // Initialize alert notification (not show when init wallet) $rootScope.txAlertCount = 0; - $notification.enableHtml5Mode(); // for chrome: if support, enable it $rootScope.$watch('txAlertCount', function(txAlertCount) { if (txAlertCount && txAlertCount > 0) { $notification.info('New Transaction', ($rootScope.txAlertCount == 1) ? 'You have a pending transaction proposal' : 'You have ' + $rootScope.txAlertCount + ' pending transaction proposals', txAlertCount); diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index b7457390a..d9e10dcd0 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copay.controllerUtils') - .factory('controllerUtils', function($rootScope, $sce, $location, Socket, video) { + .factory('controllerUtils', function($rootScope, $sce, $location, $notification, Socket, video) { var root = {}; var bitcore = require('bitcore'); @@ -49,6 +49,9 @@ angular.module('copay.controllerUtils') }; $rootScope.$digest(); }; + + $notification.enableHtml5Mode(); // for chrome: if support, enable it + w.on('badMessage', function(peerId) { $rootScope.flashMessage = { type: 'error', diff --git a/js/services/notifications.js b/js/services/notifications.js index 0ba227a04..a6ed7093f 100644 --- a/js/services/notifications.js +++ b/js/services/notifications.js @@ -3,7 +3,7 @@ angular.module('notifications', []). factory('$notification', ['$timeout',function($timeout){ - console.log('notification service online'); +// console.log('notification service online'); var notifications = JSON.parse(localStorage.getItem('$notifications')) || [], queue = [];