From e8150472c7a5421269d858133fe706271fa48491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Talha=20Bu=C4=9Fra=20Bulut?= Date: Sat, 9 Jun 2018 17:35:06 +0300 Subject: [PATCH] follow/unfollow/mute/unmute fixes mentioned in #74 and #61 --- app/templates/author.html | 8 ++++---- app/templates/directives/author-name-popover.html | 10 +++++----- src/controllers/author.js | 13 ++++++------- src/services/steem-authenticated.js | 12 ++++++------ 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/app/templates/author.html b/app/templates/author.html index 5f6c5b164d..5cce83b35f 100644 --- a/app/templates/author.html +++ b/app/templates/author.html @@ -7,10 +7,10 @@
- - - - + + + +
diff --git a/app/templates/directives/author-name-popover.html b/app/templates/directives/author-name-popover.html index b4f6aad172..a8aaa99ac3 100644 --- a/app/templates/directives/author-name-popover.html +++ b/app/templates/directives/author-name-popover.html @@ -4,11 +4,11 @@
- - - - - + + + + +

diff --git a/src/controllers/author.js b/src/controllers/author.js index 2e06d0fed2..f23c063e0b 100644 --- a/src/controllers/author.js +++ b/src/controllers/author.js @@ -460,8 +460,7 @@ export default ($scope, $rootScope, $routeParams, $timeout, $q, $location, $wind steemAuthenticatedService.follow(username).then((resp) => { afterFollow(); }).catch((e) => { - // TODO: handle error - console.log(e) + $rootScope.showError(e); }).then(() => { $scope.vBlockControl = false; $scope.vFollowing = false; @@ -483,7 +482,7 @@ export default ($scope, $rootScope, $routeParams, $timeout, $q, $location, $wind steemAuthenticatedService.unfollow(username).then((resp) => { afterUnfollow(); }).catch((e) => { - // TODO: handle error + $rootScope.showError(e); }).then(() => { $scope.vBlockControl = false; $scope.vUnfollowing = false; @@ -505,7 +504,7 @@ export default ($scope, $rootScope, $routeParams, $timeout, $q, $location, $wind steemAuthenticatedService.mute(username).then((resp) => { afterMute(); }).catch((e) => { - // TODO: handle error + $rootScope.showError(e); }).then(() => { $scope.vBlockControl = false; $scope.vMuting = false; @@ -527,7 +526,7 @@ export default ($scope, $rootScope, $routeParams, $timeout, $q, $location, $wind steemAuthenticatedService.unfollow(username).then((resp) => { afterUnmute(); }).catch((e) => { - // TODO: handle error + $rootScope.showError(e); }).then(() => { $scope.vBlockControl = false; $scope.vUnmuting = false; @@ -536,7 +535,7 @@ export default ($scope, $rootScope, $routeParams, $timeout, $q, $location, $wind $scope.fav = () => { $scope.vFavoriting = true; - eSteemService.addFavorite(activeUsername(), username).then((resp)=>{ + eSteemService.addFavorite(activeUsername(), username).then((resp) => { $scope.visitorData.favorited = true; $rootScope.$broadcast('favoritesChanged'); }).catch((e) => { @@ -548,7 +547,7 @@ export default ($scope, $rootScope, $routeParams, $timeout, $q, $location, $wind $scope.unFav = () => { $scope.vFavoriting = true; - eSteemService.removeFavoriteUser(activeUsername(), username).then((resp)=>{ + eSteemService.removeFavoriteUser(activeUsername(), username).then((resp) => { $scope.visitorData.favorited = false; $rootScope.$broadcast('favoritesChanged'); }).catch((e) => { diff --git a/src/services/steem-authenticated.js b/src/services/steem-authenticated.js index dd12277dc2..f04d5b547c 100644 --- a/src/services/steem-authenticated.js +++ b/src/services/steem-authenticated.js @@ -803,12 +803,12 @@ export default ($rootScope, steemApi, $q, cryptoService) => { return { follow: (following) => { - // requires Active or Owner key + // requires Posting key const follower = $rootScope.user.username; switch ($rootScope.user.type) { case 's': - const wif = getProperWif(['active', 'owner']); + const wif = getProperWif(['posting']); return follow(wif, follower, following); break; case 'sc': @@ -818,12 +818,12 @@ export default ($rootScope, steemApi, $q, cryptoService) => { } }, unfollow: (following) => { - // requires Active or Owner key + // requires Posting key const follower = $rootScope.user.username; switch ($rootScope.user.type) { case 's': - const wif = getProperWif(['active', 'owner']); + const wif = getProperWif(['posting']); return unfollow(wif, follower, following); break; case 'sc': @@ -833,12 +833,12 @@ export default ($rootScope, steemApi, $q, cryptoService) => { } }, mute: (following) => { - // requires Active or Owner key + // requires Posting key const follower = $rootScope.user.username; switch ($rootScope.user.type) { case 's': - const wif = getProperWif(['active', 'owner']); + const wif = getProperWif(['posting']); return ignore(wif, follower, following); break; case 'sc':