]> cat aescling's git repositories - mastodon.git/commitdiff
Wait until relationship is loaded before showing follow button (#8440)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 25 Aug 2018 20:46:59 +0000 (22:46 +0200)
committerGitHub <noreply@github.com>
Sat, 25 Aug 2018 20:46:59 +0000 (22:46 +0200)
Fix #8410

app/javascript/mastodon/features/account/components/header.js

index dd2cd406b546de5ca6011341970d9da211982e0d..eb9236aeb04e38f966427a8c8b9b9983c1fb7c69 100644 (file)
@@ -104,7 +104,9 @@ export default class Header extends ImmutablePureComponent {
     }
 
     if (me !== account.get('id')) {
-      if (account.getIn(['relationship', 'requested'])) {
+      if (!account.get('relationship')) { // Wait until the relationship is loaded
+        actionBtn = '';
+      } else if (account.getIn(['relationship', 'requested'])) {
         actionBtn = (
           <div className='account--action-button'>
             <IconButton size={26} active icon='hourglass' title={intl.formatMessage(messages.requested)} onClick={this.props.onFollow} />