@@ -5,10 +5,11 @@ import { ajax } from "discourse/lib/ajax";
55import { popupAjaxError } from "discourse/lib/ajax-error" ;
66import discourseComputed from "discourse-common/utils/decorators" ;
77
8- export default Component . extend ( {
9- loading : false ,
10- isFollowed : alias ( "user.is_followed" ) ,
11- canFollow : alias ( "user.can_follow" ) ,
8+ export default class FollowButton extends Component {
9+ loading = false ;
10+
11+ @alias ( "user.is_followed" ) isFollowed ;
12+ @alias ( "user.can_follow" ) canFollow ;
1213
1314 @discourseComputed ( "user" , "currentUser" )
1415 showButton ( user , currentUser ) {
@@ -29,7 +30,7 @@ export default Component.extend({
2930 return false ;
3031 }
3132 return true ;
32- } ,
33+ }
3334
3435 @discourseComputed ( "isFollowed" , "canFollow" )
3536 labelKey ( isFollowed , canFollow ) {
@@ -38,7 +39,7 @@ export default Component.extend({
3839 } else {
3940 return "follow.follow_button_label" ;
4041 }
41- } ,
42+ }
4243
4344 @discourseComputed ( "isFollowed" , "canFollow" )
4445 icon ( isFollowed , canFollow ) {
@@ -47,7 +48,7 @@ export default Component.extend({
4748 } else {
4849 return "user-plus" ;
4950 }
50- } ,
51+ }
5152
5253 @action
5354 toggleFollow ( ) {
@@ -61,5 +62,5 @@ export default Component.extend({
6162 . finally ( ( ) => {
6263 this . set ( "loading" , false ) ;
6364 } ) ;
64- } ,
65- } ) ;
65+ }
66+ }
0 commit comments