Fix feedback issues

This commit is contained in:
Gustavo Maximiliano Cortez 2016-11-16 11:16:20 -03:00
commit e7bb449b6e
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
11 changed files with 98 additions and 93 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('sendController', function($scope, $state, $log, $timeout, $stateParams, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, popupService, configService, lodash, feedbackService, ongoingProcess) {
angular.module('copayApp.controllers').controller('sendController', function($scope, $state, $log, $timeout, $stateParams, $ionicNavBarDelegate, $ionicHistory, $ionicConfig, gettextCatalog, popupService, configService, lodash, feedbackService, ongoingProcess) {
$scope.sendFeedback = function(feedback, skip) {
@ -33,7 +33,7 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
});
return;
}
$state.go('feedback.complete', {
$state.go('tabs.rate.complete', {
score: $stateParams.score,
skipped: skip
});
@ -41,9 +41,15 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.score = parseInt($stateParams.score);
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
$scope.feedback = {};
if ($scope.score) {
$ionicNavBarDelegate.showBackButton(false);
$ionicConfig.views.swipeBackEnabled(false);
}
else $ionicNavBarDelegate.showBackButton(true);
switch ($scope.score) {
case 1:
$scope.reaction = gettextCatalog.getString("Ouch!");