Merge pull request #5061 from cmgustavo/feat/adds-share-app

Fix animation after send feedback (back). Adds Share BitPay option in…
This commit is contained in:
Jason Dreyzehner 2016-11-16 14:59:51 -05:00 committed by GitHub
commit 57ab21dd55
5 changed files with 27 additions and 12 deletions

View File

@ -1,8 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('completeController', function($scope, $stateParams, $timeout, $log, $ionicHistory, $state, platformInfo, configService, storageService, lodash) {
$scope.score = parseInt($stateParams.score);
$scope.skipped = $stateParams.skipped == 'false' ? false : true;
$scope.isCordova = platformInfo.isCordova;
var config = configService.getSync();
@ -32,6 +30,9 @@ angular.module('copayApp.controllers').controller('completeController', function
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
$scope.skipped = (data.stateParams && data.stateParams.skipped) ? true : false;
storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null;
feedbackInfo.sent = true;
@ -92,13 +93,10 @@ angular.module('copayApp.controllers').controller('completeController', function
});
$scope.close = function() {
$ionicHistory.clearHistory();
$ionicHistory.nextViewOptions({
disableAnimate: true,
disableAnimate: false,
historyRoot: true
});
$timeout(function() {
$state.go('tabs.home');
}, 100);
$ionicHistory.goBack(-2);
};
});

View File

@ -26,13 +26,10 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
popupService.showAlert(gettextCatalog.getString('Thank you!'), gettextCatalog.getString('A member of the team will review your feedback as soon as possible.'), function() {
$scope.feedback.value = '';
$ionicHistory.nextViewOptions({
disableAnimate: true,
disableAnimate: false,
historyRoot: true
});
$ionicHistory.clearHistory();
$timeout(function() {
$state.go('tabs.settings');
});
$ionicHistory.goBack();
});
return;
}

View File

@ -9,6 +9,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
var isWP = platformInfo.isWP;
$scope.usePushNotifications = isCordova && !isWP;
$scope.isCordova = isCordova;
$scope.appName = $window.appConfig.nameCase;

View File

@ -752,6 +752,18 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
}
})
.state('tabs.feedback.shareApp', {
url: '/shareApp/:score/:skipped',
views: {
'tab-settings@tabs': {
controller: 'completeController',
templateUrl: 'views/feedback/complete.html'
}
},
customConfig: {
hideStatusBar: true
}
})
.state('tabs.rate', {
url: '/rate',
abstract: true

View File

@ -36,6 +36,13 @@
<span translate>Send Feedback</span>
<i class="icon bp-arrow-right"></i>
</a>
<a ng-if="isCordova" class="item item-icon-left item-icon-right" ui-sref="tabs.feedback.shareApp({score: 4, skipped: true})">
<i class="icon big-icon-svg">
<img src="img/icon-send-feedback.svg" class="bg"/>
</i>
<span translate>Share {{appName}}</span>
<i class="icon bp-arrow-right"></i>
</a>
<div class="item item-divider" translate>Preferences</div>