about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-08-25 22:46:59 +0200
committerGitHub <noreply@github.com>2018-08-25 22:46:59 +0200
commitcd049454be9cb8bf5fb6bc5316539432316033aa (patch)
tree9663c23a7573cd32b0a6b96536d37d00eaf87379
parentcfe3cd58d6964b098a792ec476a14c41dbcada9f (diff)
Wait until relationship is loaded before showing follow button (#8440)
Fix #8410
-rw-r--r--app/javascript/mastodon/features/account/components/header.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/account/components/header.js b/app/javascript/mastodon/features/account/components/header.js
index dd2cd406b..eb9236aeb 100644
--- a/app/javascript/mastodon/features/account/components/header.js
+++ b/app/javascript/mastodon/features/account/components/header.js
@@ -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} />