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) {
|
angular.module('copayApp.controllers').controller('rateAppStoreController', function($scope, $state, $stateParams, externalLinkService, configService, gettextCatalog, platformInfo) {
|
||||||
$scope.score = parseInt($stateParams.score);
|
$scope.score = parseInt($stateParams.score);
|
||||||
$scope.isCordova = platformInfo.isCordova;
|
|
||||||
var isAndroid = platformInfo.isAndroid;
|
var isAndroid = platformInfo.isAndroid;
|
||||||
var isIOS = platformInfo.isIOS;
|
var isIOS = platformInfo.isIOS;
|
||||||
var isWP = platformInfo.isWP;
|
var isWP = platformInfo.isWP;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'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);
|
$scope.score = parseInt($stateParams.score);
|
||||||
switch ($scope.score) {
|
switch ($scope.score) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
'use strict';
|
'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.score = parseInt($stateParams.score);
|
||||||
$scope.skip = $stateParams.skip && $scope.score == 5;
|
$scope.skip = $stateParams.skip && $scope.score == 5;
|
||||||
|
storageService.setRateCardFlag('true', function() {});
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
if (platformInfo.isCordova) {
|
var config = configService.getSync();
|
||||||
var config = configService.getSync();
|
window.plugins.socialsharing.share(config.download.url, null, null, null);
|
||||||
window.plugins.socialsharing.share(config.download.url, null, null, null);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -18,27 +18,107 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
startupService.ready();
|
startupService.ready();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!$scope.homeTip) {
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
storageService.getHomeTipAccepted(function(error, value) {
|
if (!$scope.homeTip) {
|
||||||
$scope.homeTip = (value == 'accepted') ? false : true;
|
storageService.getHomeTipAccepted(function(error, value) {
|
||||||
});
|
$scope.homeTip = (value == 'accepted') ? false : true;
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if ($scope.isNW) {
|
if ($scope.isNW) {
|
||||||
latestReleaseService.checkLatestRelease(function(err, newRelease) {
|
latestReleaseService.checkLatestRelease(function(err, newRelease) {
|
||||||
if (err) {
|
if (err) {
|
||||||
$log.warn(err);
|
$log.warn(err);
|
||||||
return;
|
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) {
|
$scope.openExternalLink = function(url, optIn, title, message, okText, cancelText) {
|
||||||
externalLinkService.open(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.setScore = function(score) {
|
||||||
$scope.score = score;
|
$scope.score = score;
|
||||||
switch ($scope.score) {
|
switch ($scope.score) {
|
||||||
|
|
@ -232,61 +312,4 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
}, 300);
|
}, 300);
|
||||||
updateAllWallets();
|
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);
|
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) {
|
root.setHideBalanceFlag = function(walletId, val, cb) {
|
||||||
storage.set('hideBalance-' + walletId, val, cb);
|
storage.set('hideBalance-' + walletId, val, cb);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,11 @@
|
||||||
<span translate>Would you be willing to rate BitPay Wallet in the app store?</span>
|
<span translate>Would you be willing to rate BitPay Wallet in the app store?</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button type="submit" class="button button-standard button-primary" ng-click="goAppStore()" ng-if="isCordova">
|
<button type="submit" class="button button-standard button-primary" ng-click="goAppStore()">
|
||||||
<span translate>Rate on the app store</span>
|
<span translate>Rate on the app store</span>
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" class="button button-standard button-primary" ng-click="sendFeedback()">
|
<button type="submit" class="button button-standard button-primary" ng-click="sendFeedback()">
|
||||||
<span translate>Send us feedback</span>
|
<span translate>Send us feedback instead</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<ion-view id="thanks-feedback">
|
<ion-view id="thanks-feedback">
|
||||||
<ion-nav-bar class="bar-royal">
|
<ion-nav-bar class="bar-royal">
|
||||||
<ion-nav-buttons side="secondary">
|
<ion-nav-buttons side="secondary">
|
||||||
<button class="button icon ion-ios-close-empty " ui-sref="tabs.home">
|
<button class="button icon ion-ios-close-empty" ui-sref="tabs.home({fromAppRate: 'true'})">
|
||||||
</button>
|
</button>
|
||||||
</ion-nav-buttons>
|
</ion-nav-buttons>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@
|
||||||
spinner="ios-small"
|
spinner="ios-small"
|
||||||
on-refresh="onRefresh()">
|
on-refresh="onRefresh()">
|
||||||
</ion-refresher>
|
</ion-refresher>
|
||||||
<div class="release" ng-show="newRelease" ng-click="openExternalLink('https://github.com/bitpay/copay/releases/latest', true, 'Update Available', 'An update to this app is available. For your security, please update to the latest version.', 'View Update', 'Go Back')">
|
<div class="release ng-hide" ng-show="newRelease" ng-click="openExternalLink('https://github.com/bitpay/copay/releases/latest', true, 'Update Available', 'An update to this app is available. For your security, please update to the latest version.', 'View Update', 'Go Back')">
|
||||||
<span translate>An update to this app is available</span><span><i class="icon bp-arrow-right"></i></span>
|
<span translate>An update to this app is available</span><span><i class="icon bp-arrow-right"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="list card">
|
<div class="list card ng-hide" ng-show="!hideRateCard">
|
||||||
<div class="item item-icon-right item-heading">
|
<div class="item item-icon-right item-heading">
|
||||||
<span translate>How do you like BitPay Wallet?</span>
|
<span translate>How do you like BitPay Wallet?</span>
|
||||||
<a><i class="icon ion-ios-close-empty close-home-tip"></i></a>
|
<a ng-click="hideCard()" ><i class="icon ion-ios-close-empty close-home-tip"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="starts item item-sub">
|
<div class="starts item item-sub">
|
||||||
<button class="button icon ion-android-star" ng-click="setScore(1)" ng-class="{'gold': 1 <= score, 'grey': 1 > score}"></button>
|
<button class="button icon ion-android-star" ng-click="setScore(1)" ng-class="{'gold': 1 <= score, 'grey': 1 > score}"></button>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue