@@ -399,7 +399,7 @@ export class FollowButton extends React.Component {
399
399
const { user, setUser } = this . context ;
400
400
401
401
//TODO: This doesn't always fire?
402
- if ( user != null ) {
402
+ if ( user != null && this . props . id != null ) {
403
403
API . followsManga ( this . props . id ) . then ( ( r ) => {
404
404
if ( this . state . isFollowed != r ) {
405
405
this . setState ( {
@@ -409,6 +409,11 @@ export class FollowButton extends React.Component {
409
409
} )
410
410
}
411
411
}
412
+ componentDidUpdate ( prevProps ) {
413
+ if ( this . props . id != prevProps . id ) {
414
+ this . componentDidMount ( ) ;
415
+ }
416
+ }
412
417
413
418
render ( ) {
414
419
const { user, setUser } = this . context ;
@@ -725,7 +730,7 @@ export class MangaDisplay extends React.Component {
725
730
< div className = "col-lg-3 col-xl-2 strong" > Actions:</ div >
726
731
< div className = "col-lg-9 col-xl-10" >
727
732
{ /*display_upload_button($templateVar["user"])*/ }
728
- < FollowButton id = { manga != null && manga . getId ( ) } />
733
+ < FollowButton id = { manga != null ? manga . getId ( ) : null } />
729
734
{ /*display_manga_rating_button($templateVar["user"]->user_id, $templateVar["manga"]->get_user_rating($templateVar["user"]->user_id), $templateVar["manga"]->manga_id)*/ }
730
735
{ /*display_edit_manga($templateVar["user"], $templateVar["manga"])*/ }
731
736
{ /*<?php if (validate_level($templateVar["user"], "member")) :
0 commit comments