commit
e286e7ea56
12 changed files with 220 additions and 77 deletions
23
src/js/controllers/proposals.js
Normal file
23
src/js/controllers/proposals.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('proposalsController',
|
||||
function($timeout, $scope, profileService, $log, txpModalService) {
|
||||
var self = this;
|
||||
|
||||
|
||||
$scope.init = function() {
|
||||
profileService.getTxps(50, function(err, txps) {
|
||||
if (err) {
|
||||
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
||||
return;
|
||||
}
|
||||
$scope.txps = txps;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 1);
|
||||
});
|
||||
}
|
||||
|
||||
$scope.openTxpModal = txpModalService.open;
|
||||
});
|
||||
|
|
@ -1,18 +1,23 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('tabHomeController',
|
||||
function($rootScope, $timeout, $scope, $state, $ionicScrollDelegate, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo, storageService) {
|
||||
function($rootScope, $timeout, $scope, $state, $ionicScrollDelegate, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo, storageService, txpModalService) {
|
||||
|
||||
$scope.externalServices = {};
|
||||
$scope.bitpayCardEnabled = true; // TODO
|
||||
|
||||
var setNotifications = function(notifications) {
|
||||
$scope.notifications = notifications;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 1);
|
||||
|
||||
|
||||
var setPendingTxps = function(txps) {
|
||||
if (!txps) {
|
||||
$scope.txps = [];
|
||||
return;
|
||||
}
|
||||
$scope.txps = lodash.sortBy(txps, 'createdOn').reverse();
|
||||
};
|
||||
|
||||
|
||||
|
||||
$scope.updateAllWallets = function() {
|
||||
$scope.wallets = profileService.getWallets();
|
||||
if (lodash.isEmpty($scope.wallets)) return;
|
||||
|
|
@ -26,9 +31,25 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
walletService.getStatus(wallet, {}, function(err, status) {
|
||||
if (err) {
|
||||
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
||||
return;
|
||||
} else {
|
||||
wallet.status = status;
|
||||
}
|
||||
if (++j==i) {
|
||||
profileService.getTxps({
|
||||
limit: 3
|
||||
}, function(err, txps, n) {
|
||||
if (err) {
|
||||
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
||||
}
|
||||
$scope.txps = txps;
|
||||
$scope.txpsN = n;
|
||||
$ionicScrollDelegate.resize();
|
||||
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 1);
|
||||
});
|
||||
}
|
||||
wallet.status = status;
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -41,8 +62,13 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
return;
|
||||
}
|
||||
$scope.fetchingNotifications = false;
|
||||
setNotifications(n);
|
||||
$scope.notifications = n;
|
||||
$ionicScrollDelegate.resize();
|
||||
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 1);
|
||||
|
||||
})
|
||||
};
|
||||
|
||||
|
|
@ -57,13 +83,27 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
|
||||
profileService.getNotifications({
|
||||
limit: 3
|
||||
}, function(err, n) {
|
||||
}, function(err, notifications) {
|
||||
if (err) {
|
||||
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
||||
return;
|
||||
}
|
||||
setNotifications(n);
|
||||
$ionicScrollDelegate.resize();
|
||||
$scope.notifications = notifications;
|
||||
|
||||
profileService.getTxps({
|
||||
limit: 3
|
||||
}, function(err, txps, n) {
|
||||
if (err) {
|
||||
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
||||
}
|
||||
$scope.txps = txps;
|
||||
$scope.txpsN = n;
|
||||
$ionicScrollDelegate.resize();
|
||||
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 1);
|
||||
})
|
||||
})
|
||||
});
|
||||
};
|
||||
|
|
@ -101,4 +141,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
|
||||
});
|
||||
|
||||
$scope.openTxpModal = txpModalService.open;
|
||||
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $ionicNavBarDelegate, $state, $stateParams, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService, $ionicPopup) {
|
||||
angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $ionicNavBarDelegate, $state, $stateParams, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService, $ionicPopup, txpModalService) {
|
||||
|
||||
var isCordova = platformInfo.isCordova;
|
||||
var isWP = platformInfo.isWP;
|
||||
|
|
@ -47,26 +47,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
};
|
||||
|
||||
|
||||
var glideraActive = true; // TODO TODO TODO
|
||||
// isGlidera flag is a security measure so glidera status is not
|
||||
// only determined by the tx.message
|
||||
$scope.openTxpModal = function(tx) {
|
||||
var config = configService.getSync().wallet;
|
||||
var scope = $rootScope.$new(true);
|
||||
scope.tx = tx;
|
||||
scope.wallet = tx.wallet;
|
||||
scope.copayers = tx.wallet.copayers;
|
||||
scope.isGlidera = glideraActive;
|
||||
scope.currentSpendUnconfirmed = config.spendUnconfirmed;
|
||||
|
||||
$ionicModal.fromTemplateUrl('views/modals/txp-details.html', {
|
||||
scope: scope
|
||||
}).then(function(modal) {
|
||||
scope.txpDetailsModal = modal;
|
||||
scope.txpDetailsModal.show();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.openTxpModal = txpModalService.open;
|
||||
|
||||
var listeners = [
|
||||
$rootScope.$on('bwsEvent', function(e, walletId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue