fixed karma test bug
This commit is contained in:
parent
d800a98df0
commit
0c03af53a8
8 changed files with 44 additions and 30 deletions
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('HeaderController',
|
||||
function($scope, $rootScope, $location, $notification, $http, controllerUtils) {
|
||||
function($scope, $rootScope, $location, notification, $http, controllerUtils) {
|
||||
$scope.menu = [
|
||||
{
|
||||
'title': 'Addresses',
|
||||
|
|
@ -64,7 +64,7 @@ angular.module('copayApp.controllers').controller('HeaderController',
|
|||
}
|
||||
if (currentAddr) {
|
||||
//var beep = new Audio('sound/transaction.mp3');
|
||||
$notification.funds('Received fund', currentAddr, receivedFund);
|
||||
notification.funds('Received fund', currentAddr, receivedFund);
|
||||
//beep.play();
|
||||
}
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ angular.module('copayApp.controllers').controller('HeaderController',
|
|||
|
||||
$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);
|
||||
notification.info('New Transaction', ($rootScope.txAlertCount == 1) ? 'You have a pending transaction proposal' : 'You have ' + $rootScope.txAlertCount + ' pending transaction proposals', txAlertCount);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
var BackupService = function($notification) {
|
||||
this.notifications = $notification;
|
||||
|
||||
var BackupService = function(notification) {
|
||||
this.notifications = notification;
|
||||
};
|
||||
|
||||
BackupService.prototype.getName = function(wallet) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
var bitcore = require('bitcore');
|
||||
|
||||
angular.module('copayApp.services')
|
||||
.factory('controllerUtils', function($rootScope, $sce, $location, $notification, $timeout, Socket, video) {
|
||||
.factory('controllerUtils', function($rootScope, $sce, $location, notification, $timeout, Socket, video) {
|
||||
var root = {};
|
||||
|
||||
root.getVideoMutedStatus = function(copayer) {
|
||||
|
|
@ -87,7 +87,7 @@ angular.module('copayApp.services')
|
|||
$rootScope.$digest();
|
||||
};
|
||||
|
||||
$notification.enableHtml5Mode(); // for chrome: if support, enable it
|
||||
notification.enableHtml5Mode(); // for chrome: if support, enable it
|
||||
|
||||
w.on('badMessage', function(peerId) {
|
||||
$rootScope.$flashMessage = {
|
||||
|
|
@ -126,11 +126,11 @@ angular.module('copayApp.services')
|
|||
switch (e.type) {
|
||||
case 'signed':
|
||||
var user = w.publicKeyRing.nicknameForCopayer(e.cId);
|
||||
$notification.info('Transaction Update', 'A transaction was signed by ' + user);
|
||||
notification.info('Transaction Update', 'A transaction was signed by ' + user);
|
||||
break;
|
||||
case 'rejected':
|
||||
var user = w.publicKeyRing.nicknameForCopayer(e.cId);
|
||||
$notification.info('Transaction Update', 'A transaction was rejected by ' + user);
|
||||
notification.info('Transaction Update', 'A transaction was rejected by ' + user);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').
|
||||
factory('$notification', ['$timeout',function($timeout){
|
||||
factory('notification', ['$timeout',function($timeout){
|
||||
|
||||
var notifications = JSON.parse(localStorage.getItem('$notifications')) || [],
|
||||
var notifications = JSON.parse(localStorage.getItem('notifications')) || [],
|
||||
queue = [];
|
||||
|
||||
var settings = {
|
||||
|
|
@ -186,7 +186,7 @@ angular.module('copayApp.services').
|
|||
save: function(){
|
||||
// Save all the notifications into localStorage
|
||||
if(settings.localStorage){
|
||||
localStorage.setItem('$notifications', JSON.stringify(notifications));
|
||||
localStorage.setItem('notifications', JSON.stringify(notifications));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ angular.module('copayApp.services').
|
|||
|
||||
};
|
||||
}]).
|
||||
directive('notifications', ['$notification', '$compile', function($notification, $compile){
|
||||
directive('notifications', function(notification, $compile){
|
||||
/**
|
||||
*
|
||||
* It should also parse the arguments passed to it that specify
|
||||
|
|
@ -245,7 +245,7 @@ angular.module('copayApp.services').
|
|||
template: html,
|
||||
link: link,
|
||||
controller: ['$scope', function NotificationsCtrl( $scope ){
|
||||
$scope.queue = $notification.getQueue();
|
||||
$scope.queue = notification.getQueue();
|
||||
|
||||
$scope.removeNotification = function(noti){
|
||||
$scope.queue.splice($scope.queue.indexOf(noti), 1);
|
||||
|
|
@ -254,4 +254,9 @@ angular.module('copayApp.services').
|
|||
]
|
||||
|
||||
};
|
||||
}]);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ var Video = function() {
|
|||
|
||||
this.mediaConnections = {};
|
||||
this.localStream = null;
|
||||
this.onlineSound = new Audio('sound/online.wav');
|
||||
if (typeof Audio !== 'undefined') {
|
||||
this.onlineSound = new Audio('sound/online.wav');
|
||||
}
|
||||
};
|
||||
|
||||
Video.prototype.setOwnPeer = function(peer, wallet, cb) {
|
||||
|
|
@ -64,7 +66,7 @@ Video.prototype._addCall = function(mediaConnection, cb) {
|
|||
|
||||
// Wait for stream on the call, then set peer video display
|
||||
mediaConnection.on('stream', function(stream) {
|
||||
self.onlineSound.play();
|
||||
if (self.onlineSound) self.onlineSound.play();
|
||||
cb(null, peerID, URL.createObjectURL(stream));
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue