about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-08-27 17:43:55 +0200
committerThibG <thib@sitedethib.com>2018-08-27 20:21:12 +0200
commit3106c81b1e96cdcb5de9afa3507f344dc11705a3 (patch)
treebeae36a770ad3394cbc7acff2fe205ea5260b0d3
parent8852fff3a43ea4ac26aef5c7f0d72f3db3b421a0 (diff)
[Glitch] Wait until relationship is loaded before showing follow button
Port cd049454be9cb8bf5fb6bc5316539432316033aa to glitch-soc
-rw-r--r--app/javascript/flavours/glitch/features/account/components/header.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/account/components/header.js b/app/javascript/flavours/glitch/features/account/components/header.js
index 174df0cc9..eda0d637e 100644
--- a/app/javascript/flavours/glitch/features/account/components/header.js
+++ b/app/javascript/flavours/glitch/features/account/components/header.js
@@ -56,7 +56,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} />