remove external services for this first release and general refactors
This commit is contained in:
parent
14e0cc2e0f
commit
95f3ddf01a
11 changed files with 36 additions and 32 deletions
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('advancedSettingsController', function($scope, $log, configService) {
|
||||
angular.module('copayApp.controllers').controller('advancedSettingsController', function($scope, $log, configService, platformInfo) {
|
||||
|
||||
var updateConfig = function() {
|
||||
var config = configService.getSync();
|
||||
|
|
@ -50,6 +50,7 @@ angular.module('copayApp.controllers').controller('advancedSettingsController',
|
|||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
updateConfig();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
|
|||
$scope.appName = appConfigService.nameCase;
|
||||
var isAndroid = platformInfo.isAndroid;
|
||||
var isIOS = platformInfo.isIOS;
|
||||
var isWP = platformInfo.isWP;
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
|
||||
var config = configService.getSync();
|
||||
|
||||
$scope.skip = function() {
|
||||
|
|
@ -42,7 +43,7 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
|
|||
url = $scope.appName == 'Copay' ? defaults.rateApp.copay.android : defaults.rateApp.bitpay.android;
|
||||
if (isIOS)
|
||||
url = $scope.appName == 'Copay' ? defaults.rateApp.copay.ios : defaults.rateApp.bitpay.ios;
|
||||
// if (isWP)
|
||||
// if (isWindowsPhoneApp)
|
||||
// url = $scope.appName == 'Copay' ? defaults.rateApp.copay.windows : defaults.rateApp.bitpay.windows;
|
||||
|
||||
externalLinkService.open(url);
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
};
|
||||
|
||||
$scope.openScanner = function() {
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
|
||||
|
||||
if (!isWindowsPhoneApp) {
|
||||
$state.go('tabs.scan');
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro
|
|||
|
||||
$scope.chooseScanner = function() {
|
||||
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
|
||||
|
||||
if (!isWindowsPhoneApp) {
|
||||
$state.go('tabs.scan');
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ angular.module('copayApp.directives')
|
|||
link: function(scope, el, attrs) {
|
||||
|
||||
scope.chooseScanner = function() {
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
|
||||
|
||||
if (!isWindowsPhoneApp) {
|
||||
scope.openScanner();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
|
|||
var credentials = {};
|
||||
var isCordova = platformInfo.isCordova;
|
||||
var isNW = platformInfo.isNW;
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
|
||||
|
||||
root.priceSensitivity = [{
|
||||
value: 0.5,
|
||||
|
|
@ -303,14 +303,14 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
|
|||
};
|
||||
|
||||
root.getBuyOrder = function(token, accountId, buyId, cb) {
|
||||
if (!token) return cb('Invalid Token');
|
||||
$http(_get('/accounts/' + accountId + '/buys/' + buyId, token)).then(function(data) {
|
||||
$log.info('Coinbase Buy Info: SUCCESS');
|
||||
return cb(null, data.data);
|
||||
}, function(data) {
|
||||
$log.error('Coinbase Buy Info: ERROR ' + data.statusText);
|
||||
return cb(data.data);
|
||||
});
|
||||
if (!token) return cb('Invalid Token');
|
||||
$http(_get('/accounts/' + accountId + '/buys/' + buyId, token)).then(function(data) {
|
||||
$log.info('Coinbase Buy Info: SUCCESS');
|
||||
return cb(null, data.data);
|
||||
}, function(data) {
|
||||
$log.error('Coinbase Buy Info: ERROR ' + data.statusText);
|
||||
return cb(data.data);
|
||||
});
|
||||
};
|
||||
|
||||
root.getTransaction = function(token, accountId, transactionId, cb) {
|
||||
|
|
@ -723,7 +723,7 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
|
|||
|
||||
var register = function() {
|
||||
|
||||
root.isActive(function(err, isActive){
|
||||
root.isActive(function(err, isActive) {
|
||||
if (err) return;
|
||||
|
||||
buyAndSellService.register({
|
||||
|
|
@ -742,7 +742,7 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
|
|||
|
||||
$rootScope.$on('bwsEvent', function(e, walletId, type, n) {
|
||||
if (type == 'NewBlock' && n && n.data && n.data.network == 'livenet') {
|
||||
root.isActive(function(err,isActive){
|
||||
root.isActive(function(err, isActive) {
|
||||
// Update Coinbase
|
||||
if (isActive)
|
||||
root.updatePendingTransactions();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').factory('configService', function(storageService, lodash, $log, $timeout, $rootScope) {
|
||||
angular.module('copayApp.services').factory('configService', function(storageService, lodash, $log, $timeout, $rootScope, platformInfo) {
|
||||
var root = {};
|
||||
|
||||
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
|
||||
|
||||
var defaultConfig = {
|
||||
// wallet limits
|
||||
limits: {
|
||||
|
|
@ -65,7 +67,7 @@ angular.module('copayApp.services').factory('configService', function(storageSer
|
|||
},
|
||||
|
||||
hideNextSteps: {
|
||||
enabled: false,
|
||||
enabled: isWindowsPhoneApp ? true : false,
|
||||
},
|
||||
|
||||
rates: {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
|||
var root = {};
|
||||
var credentials = {};
|
||||
var isCordova = platformInfo.isCordova;
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
|
||||
|
||||
var setCredentials = function() {
|
||||
if (!$window.externalServices || !$window.externalServices.glidera) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
angular.module('copayApp.services').factory('ongoingProcess', function($log, $timeout, $filter, lodash, $ionicLoading, gettext, platformInfo) {
|
||||
var root = {};
|
||||
var isCordova = platformInfo.isCordova;
|
||||
var isWP = platformInfo.isWP;
|
||||
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
|
||||
|
||||
var ongoingProcess = {};
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
|
|||
|
||||
root.clear = function() {
|
||||
ongoingProcess = {};
|
||||
if (isCordova && !isWP) {
|
||||
if (isCordova && !isWindowsPhoneApp) {
|
||||
window.plugins.spinnerDialog.hide();
|
||||
} else {
|
||||
$ionicLoading.hide();
|
||||
|
|
@ -81,19 +81,19 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
|
|||
if (customHandler) {
|
||||
customHandler(processName, showName, isOn);
|
||||
} else if (root.onGoingProcessName) {
|
||||
if (isCordova && !isWP) {
|
||||
if (isCordova && !isWindowsPhoneApp) {
|
||||
window.plugins.spinnerDialog.show(null, showName, root.clear);
|
||||
} else {
|
||||
|
||||
var tmpl;
|
||||
if (isWP) tmpl = '<div>' + showName + '</div>';
|
||||
if (isWindowsPhoneApp) tmpl = '<div>' + showName + '</div>';
|
||||
else tmpl = '<div class="item-icon-left">' + showName + '<ion-spinner class="spinner-stable" icon="lines"></ion-spinner></div>';
|
||||
$ionicLoading.show({
|
||||
template: tmpl
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (isCordova && !isWP) {
|
||||
if (isCordova && !isWindowsPhoneApp) {
|
||||
window.plugins.spinnerDialog.hide();
|
||||
} else {
|
||||
$ionicLoading.hide();
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ angular.module('copayApp.services')
|
|||
|
||||
var isChromeApp = platformInfo.isChromeApp;
|
||||
var isCordova = platformInfo.isCordova;
|
||||
var isWP = platformInfo.isWP;
|
||||
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
|
||||
var isIOS = platformInfo.isIOS;
|
||||
|
||||
var root = {};
|
||||
var errors = bwcService.getErrors();
|
||||
var usePushNotifications = isCordova && !isWP;
|
||||
var usePushNotifications = isCordova && !isWindowsPhoneApp;
|
||||
|
||||
var UPDATE_PERIOD = 15;
|
||||
|
||||
|
|
@ -208,9 +208,9 @@ angular.module('copayApp.services')
|
|||
};
|
||||
|
||||
var shouldSkipValidation = function(walletId) {
|
||||
return root.profile.isChecked(platformInfo.ua, walletId) || isIOS || isWP;
|
||||
}
|
||||
// Used when reading wallets from the profile
|
||||
return root.profile.isChecked(platformInfo.ua, walletId) || isIOS || isWindowsPhoneApp;
|
||||
}
|
||||
// Used when reading wallets from the profile
|
||||
root.bindWallet = function(credentials, cb) {
|
||||
if (!credentials.walletId || !credentials.m)
|
||||
return cb('bindWallet should receive credentials JSON');
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<div class="item item-divider"></div>
|
||||
|
||||
<ion-toggle class="has-comment" ng-show="!isWP" ng-model="recentTransactionsEnabled.value" toggle-class="toggle-balanced" ng-change="recentTransactionsChange()">
|
||||
<ion-toggle class="has-comment" ng-model="recentTransactionsEnabled.value" toggle-class="toggle-balanced" ng-change="recentTransactionsChange()">
|
||||
<span class="toggle-label" translate>Recent Transaction Card</span>
|
||||
</ion-toggle>
|
||||
<div class="comment" translate>
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
<div class="item item-divider"></div>
|
||||
|
||||
<ion-toggle ng-model="hideNextSteps.value" toggle-class="toggle-balanced" ng-change="nextStepsChange()">
|
||||
<ion-toggle ng-model="hideNextSteps.value" ng-if="!isWindowsPhoneApp" toggle-class="toggle-balanced" ng-change="nextStepsChange()">
|
||||
<span class="toggle-label" translate>Hide Next Steps Card</span>
|
||||
</ion-toggle>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue