My Dashboard Button Doesn't Show Up Unless I Refresh

Why do I have to refresh the page to have the Dashboard button show up?

I’ve been getting asked this question, and seeing it posted enough that I wanted to provide my solution to this problem (video below). It’s something that I like using, and have had good feedback from with my own site members.

Step 1:

I swap out the button for a “loading spinner” graphic on the welcome page:

Screen Shot 2020-02-23 at 1.10.43 AM

Step 2:

I auto-redirect them to their unique dashboard once it’s all setup:

Screen Shot 2020-02-23 at 1.12.51 AM

(You can read about why this is happening , and how it’s not specific to MemberStack if curious)

I use a tad bit of custom code (added to the Welcome page settings in Webflow) and ping the MemberStack API looking for my logged in members “Members Page” to be filled out:

<script>
var Webflow = Webflow || [];
Webflow.push(function() {
  MemberStack.onReady.then(function(member) {
   if(member.memberPage){
    window.location.replace(member.memberPage);
   }else{
   	setTimeout(function() { location.reload(true); }, 3000);
   }
	})
});
</script>

Here’s a quick video of it:

You can also download the guide to walk through this setup at your own pace .

1 Like

Hey @ChrisDrit thanks for creating this, it’s great!!

2 Likes

Happy to do it Molly!

1 Like

Hi Chris,

By far the best UX solution to this problem, so thanks for posting!

My welcome page ‘hidden’ in a client-area folder, so when the script loads it directs the user to client-area/dashboards/5e512c2… and can’t find the page. I need it to direct the user out of the parent folder then into dashboards/5e512c2…

Any idea how to do that?

Thanks!

2 Likes

Thanks for the kind words @Thomas_Christensen :smile:

window.location.replace(member.memberPage);

So this bit of the code I posted will redirect you to whatever you have stored in the MemberStack “Member page” under a members profile.

If you’d like the redirect to go to the sub-folder, make sure it’s listed here, if not, make sure it’s not listed here.

Another solution, can you simply remove the client-area sub-folder?

1 Like

Yes, that did the trick!

After gating the /dashboards folder, there was no reason to have the client-area blocking users as well so that was an easy one. I guess I should have thought of that :smile:

Thanks Chris

2 Likes