add rate card flag
This commit is contained in:
parent
9e3f627c58
commit
7b2d3b1df0
8 changed files with 111 additions and 82 deletions
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('rateAppStoreController', function($scope, $state, $stateParams, externalLinkService, configService, gettextCatalog, platformInfo) {
|
||||
$scope.score = parseInt($stateParams.score);
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
var isAndroid = platformInfo.isAndroid;
|
||||
var isIOS = platformInfo.isIOS;
|
||||
var isWP = platformInfo.isWP;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('sendFeedbackController', function($scope, $state, $timeout, $stateParams, gettextCatalog) {
|
||||
angular.module('copayApp.controllers').controller('sendFeedbackController', function($scope, $state, $stateParams, gettextCatalog) {
|
||||
$scope.score = parseInt($stateParams.score);
|
||||
switch ($scope.score) {
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('thanksController', function($scope, $state, $stateParams, platformInfo, configService) {
|
||||
angular.module('copayApp.controllers').controller('thanksController', function($scope, $stateParams, configService, storageService) {
|
||||
$scope.score = parseInt($stateParams.score);
|
||||
$scope.skip = $stateParams.skip && $scope.score == 5;
|
||||
storageService.setRateCardFlag('true', function() {});
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
if (platformInfo.isCordova) {
|
||||
var config = configService.getSync();
|
||||
window.plugins.socialsharing.share(config.download.url, null, null, null);
|
||||
}
|
||||
var config = configService.getSync();
|
||||
window.plugins.socialsharing.share(config.download.url, null, null, null);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,27 +18,107 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
startupService.ready();
|
||||
});
|
||||
|
||||
if (!$scope.homeTip) {
|
||||
storageService.getHomeTipAccepted(function(error, value) {
|
||||
$scope.homeTip = (value == 'accepted') ? false : true;
|
||||
});
|
||||
}
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
if (!$scope.homeTip) {
|
||||
storageService.getHomeTipAccepted(function(error, value) {
|
||||
$scope.homeTip = (value == 'accepted') ? false : true;
|
||||
});
|
||||
}
|
||||
|
||||
if ($scope.isNW) {
|
||||
latestReleaseService.checkLatestRelease(function(err, newRelease) {
|
||||
if (err) {
|
||||
$log.warn(err);
|
||||
return;
|
||||
}
|
||||
if ($scope.isNW) {
|
||||
latestReleaseService.checkLatestRelease(function(err, newRelease) {
|
||||
if (err) {
|
||||
$log.warn(err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (newRelease) $scope.newRelease = true;
|
||||
if (newRelease) $scope.newRelease = true;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.hideRateCard = $stateParams.fromAppRate || !$scope.isCordova;
|
||||
if (!$scope.hideRateCard) {
|
||||
storageService.getRateCardFlag(function(error, value) {
|
||||
$scope.hideRateCard = (value == 'true') ? true : false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data) {
|
||||
updateAllWallets();
|
||||
|
||||
addressbookService.list(function(err, ab) {
|
||||
if (err) $log.error(err);
|
||||
$scope.addressbook = ab || {};
|
||||
});
|
||||
}
|
||||
|
||||
listeners = [
|
||||
$rootScope.$on('bwsEvent', function(e, walletId, type, n) {
|
||||
var wallet = profileService.getWallet(walletId);
|
||||
updateWallet(wallet);
|
||||
if ($scope.recentTransactionsEnabled) getNotifications();
|
||||
}),
|
||||
$rootScope.$on('Local/TxAction', function(e, walletId) {
|
||||
$log.debug('Got action for wallet ' + walletId);
|
||||
var wallet = profileService.getWallet(walletId);
|
||||
updateWallet(wallet);
|
||||
if ($scope.recentTransactionsEnabled) getNotifications();
|
||||
})
|
||||
];
|
||||
|
||||
configService.whenAvailable(function() {
|
||||
nextStep(function() {
|
||||
var config = configService.getSync();
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
|
||||
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
|
||||
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
|
||||
$scope.amazonEnabled = config.amazon.enabled;
|
||||
$scope.bitpayCardEnabled = config.bitpayCard.enabled;
|
||||
|
||||
var buyAndSellEnabled = !$scope.externalServices.BuyAndSell && ($scope.glideraEnabled || $scope.coinbaseEnabled);
|
||||
var amazonEnabled = !$scope.externalServices.AmazonGiftCards && $scope.amazonEnabled;
|
||||
var bitpayCardEnabled = !$scope.externalServices.BitpayCard && $scope.bitpayCardEnabled;
|
||||
|
||||
$scope.nextStepEnabled = buyAndSellEnabled || amazonEnabled || bitpayCardEnabled;
|
||||
$scope.recentTransactionsEnabled = config.recentTransactions.enabled;
|
||||
|
||||
if ($scope.recentTransactionsEnabled) getNotifications();
|
||||
|
||||
if ($scope.bitpayCardEnabled) bitpayCardCache();
|
||||
$timeout(function() {
|
||||
$ionicScrollDelegate.resize();
|
||||
$scope.$apply();
|
||||
}, 10);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.leave", function(event, data) {
|
||||
lodash.each(listeners, function(x) {
|
||||
x();
|
||||
});
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.leave", function(event, data) {
|
||||
lodash.each(listeners, function(x) {
|
||||
x();
|
||||
});
|
||||
});
|
||||
|
||||
$scope.openExternalLink = function(url, optIn, title, message, okText, cancelText) {
|
||||
externalLinkService.open(url, optIn, title, message, okText, cancelText);
|
||||
};
|
||||
|
||||
$scope.hideCard = function() {
|
||||
storageService.setRateCardFlag('true', function() {
|
||||
$scope.hideRateCard = true;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
$scope.setScore = function(score) {
|
||||
$scope.score = score;
|
||||
switch ($scope.score) {
|
||||
|
|
@ -232,61 +312,4 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
}, 300);
|
||||
updateAllWallets();
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
updateAllWallets();
|
||||
|
||||
addressbookService.list(function(err, ab) {
|
||||
if (err) $log.error(err);
|
||||
$scope.addressbook = ab || {};
|
||||
});
|
||||
|
||||
listeners = [
|
||||
$rootScope.$on('bwsEvent', function(e, walletId, type, n) {
|
||||
var wallet = profileService.getWallet(walletId);
|
||||
updateWallet(wallet);
|
||||
if ($scope.recentTransactionsEnabled) getNotifications();
|
||||
}),
|
||||
$rootScope.$on('Local/TxAction', function(e, walletId) {
|
||||
$log.debug('Got action for wallet ' + walletId);
|
||||
var wallet = profileService.getWallet(walletId);
|
||||
updateWallet(wallet);
|
||||
if ($scope.recentTransactionsEnabled) getNotifications();
|
||||
})
|
||||
];
|
||||
|
||||
configService.whenAvailable(function() {
|
||||
nextStep(function() {
|
||||
var config = configService.getSync();
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
|
||||
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
|
||||
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
|
||||
$scope.amazonEnabled = config.amazon.enabled;
|
||||
$scope.bitpayCardEnabled = config.bitpayCard.enabled;
|
||||
|
||||
var buyAndSellEnabled = !$scope.externalServices.BuyAndSell && ($scope.glideraEnabled || $scope.coinbaseEnabled);
|
||||
var amazonEnabled = !$scope.externalServices.AmazonGiftCards && $scope.amazonEnabled;
|
||||
var bitpayCardEnabled = !$scope.externalServices.BitpayCard && $scope.bitpayCardEnabled;
|
||||
|
||||
$scope.nextStepEnabled = buyAndSellEnabled || amazonEnabled || bitpayCardEnabled;
|
||||
$scope.recentTransactionsEnabled = config.recentTransactions.enabled;
|
||||
|
||||
if ($scope.recentTransactionsEnabled) getNotifications();
|
||||
|
||||
if ($scope.bitpayCardEnabled) bitpayCardCache();
|
||||
$timeout(function() {
|
||||
$ionicScrollDelegate.resize();
|
||||
$scope.$apply();
|
||||
}, 10);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.leave", function(event, data) {
|
||||
lodash.each(listeners, function(x) {
|
||||
x();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -203,6 +203,14 @@ angular.module('copayApp.services')
|
|||
storage.set('homeTip', val, cb);
|
||||
};
|
||||
|
||||
root.getRateCardFlag = function(cb) {
|
||||
storage.get('rateCardFlag', cb);
|
||||
};
|
||||
|
||||
root.setRateCardFlag = function(val, cb) {
|
||||
storage.set('rateCardFlag', val, cb);
|
||||
};
|
||||
|
||||
root.setHideBalanceFlag = function(walletId, val, cb) {
|
||||
storage.set('hideBalance-' + walletId, val, cb);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue