fix(feedback): more feedback flow improvements and bug fixes

This commit is contained in:
Jason Dreyzehner 2016-11-17 00:56:12 -05:00
commit 63c7684259
10 changed files with 89 additions and 59 deletions

View file

@ -4,42 +4,63 @@ angular.module('copayApp.controllers').controller('completeController', function
$scope.isCordova = platformInfo.isCordova;
var config = configService.getSync();
function quickFeedback(cb){
window.plugins.spinnerDialog.show();
$timeout(window.plugins.spinnerDialog.hide, 300);
$timeout(cb, 20);
}
$scope.shareFacebook = function() {
window.plugins.socialsharing.shareVia($scope.shareFacebookVia, null, null, null, config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareVia($scope.shareFacebookVia, null, null, null, config.download.url);
});
};
$scope.shareTwitter = function() {
window.plugins.socialsharing.shareVia($scope.shareTwitterVia, null, null, null, config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareVia($scope.shareTwitterVia, null, null, null, config.download.url);
});
};
$scope.shareGooglePlus = function() {
window.plugins.socialsharing.shareVia($scope.shareGooglePlusVia, config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareVia($scope.shareGooglePlusVia, config.download.url);
});
};
$scope.shareEmail = function() {
window.plugins.socialsharing.shareViaEmail(config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareViaEmail(config.download.url);
});
};
$scope.shareWhatsapp = function() {
window.plugins.socialsharing.shareViaWhatsApp(config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareViaWhatsApp(config.download.url);
});
};
$scope.shareMessage = function() {
window.plugins.socialsharing.shareViaSMS(config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareViaSMS(config.download.url);
});
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.$on("$ionicView.afterEnter", function() {
if (!$scope.fromSettings) {
$ionicConfig.views.swipeBackEnabled(false);
} else {
$ionicNavBarDelegate.showBackButton(true);
$ionicConfig.views.swipeBackEnabled(true);
}
});
$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;
$scope.rated = (data.stateParams && data.stateParams.rated) ? true : false;
$scope.fromSettings = (data.stateParams && data.stateParams.fromSettings) ? true : false;
if (!$scope.fromSettings) {
$ionicNavBarDelegate.showBackButton(false);
$ionicConfig.views.swipeBackEnabled(false);
} else $ionicNavBarDelegate.showBackButton(true);
storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null;
feedbackInfo.sent = true;