show receive tips
This commit is contained in:
parent
c6e459add3
commit
3c353fdbcb
5 changed files with 63 additions and 1 deletions
15
public/views/modals/receive-tips.html
Normal file
15
public/views/modals/receive-tips.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<ion-modal-view ng-style="{opacity: '0.9'}" ng-controller="receiveTipsController">
|
||||
<ion-nav-bar class="bar-ligt">
|
||||
<ion-nav-buttons side="secondary">
|
||||
<button class="button" ng-click="close()">
|
||||
X
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
</ion-nav-bar>
|
||||
<ion-content class="has-header">
|
||||
<div class="text-center">
|
||||
<h2>Receive bitcoin by sharing your address</h2>
|
||||
<h3>Other bitcoin users can scan this code to send you money</h3>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-modal-view>
|
||||
15
public/views/modals/scan-tips.html
Normal file
15
public/views/modals/scan-tips.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<ion-modal-view ng-style="{opacity: '0.9'}">
|
||||
<ion-nav-bar class="bar-ligt">
|
||||
<ion-nav-buttons side="secondary">
|
||||
<button class="button" ng-click="scanTipsModal.hide()">
|
||||
X
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
</ion-nav-bar>
|
||||
<ion-content class="has-header">
|
||||
<div class="text-center">
|
||||
<h2>Receive bitcoin by sharing your address</h2>
|
||||
<h3>Other bitcoin users can scan this code to send you money</h3>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-modal-view>
|
||||
11
src/js/controllers/modals/receiveTips.js
Normal file
11
src/js/controllers/modals/receiveTips.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('receiveTipsController', function($scope, $log, storageService) {
|
||||
$scope.close = function() {
|
||||
$log.debug('Receive tips accepted');
|
||||
storageService.setReceiveTipsAccepted(true, function(err) {
|
||||
$scope.receiveTipsModal.hide();
|
||||
$scope.receiveTipsModal.remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('tabReceiveController', function($scope, $timeout, $log, platformInfo, walletService, profileService, configService, lodash, gettextCatalog, popupService) {
|
||||
angular.module('copayApp.controllers').controller('tabReceiveController', function($scope, $timeout, $log, $ionicModal, storageService, platformInfo, walletService, profileService, configService, lodash, gettextCatalog, popupService) {
|
||||
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
|
||||
|
|
@ -10,6 +10,19 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
|
|||
});
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
$scope.isNW = platformInfo.isNW;
|
||||
|
||||
storageService.getReceiveTipsAccepted(function(err, accepted) {
|
||||
if (err || accepted) return;
|
||||
|
||||
$timeout(function() {
|
||||
$ionicModal.fromTemplateUrl('views/modals/receive-tips.html', {
|
||||
scope: $scope
|
||||
}).then(function(modal) {
|
||||
$scope.receiveTipsModal = modal;
|
||||
$scope.receiveTipsModal.show();
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
$scope.$on('Wallet/Changed', function(event, wallet) {
|
||||
|
|
|
|||
|
|
@ -342,6 +342,14 @@ angular.module('copayApp.services')
|
|||
});
|
||||
};
|
||||
|
||||
root.setReceiveTipsAccepted = function(val, cb) {
|
||||
storage.set('receiveTips', val, cb);
|
||||
};
|
||||
|
||||
root.getReceiveTipsAccepted = function(cb) {
|
||||
storage.get('receiveTips', cb);
|
||||
};
|
||||
|
||||
root.setAmazonGiftCards = function(network, gcs, cb) {
|
||||
storage.set('amazonGiftCards-' + network, gcs, cb);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue