Page Reload code

Hello community,
i kind of need a page reload code, so as to save the user from reloading manually, this is to due to slow in processing from stripe and softr…

Can you say a little more about what exactly you need here? Reloading the page from a bit of custom code is easy, but knowing when it do it can be tricky.

okay there is a checkout page which link to the home page

now the home page features is set to paid users and non paid users. now when payment is made on the checkout page which out to lead to the paid user home page, it still show the non-paid user page. so the user have to manually refresh the page before it display the paid user page…

so i am asking for a custom code such that after making payment on the checkout page, it leads to the home page and perform the reload/page refresh by itself.

This is a known recent problem, that might come from Stripe at first.
I just wonder if reloading the page with custom code would solve anything as it appears that this issue can last more than seconds…
I have the issue with a client. Reloading doesn’t change anything.
The dev team is aware of this and ready to solve it.

yeah i get you sir,

but since manual reload kinda works, just looking at the case where the system can reload itself for the sake of users who aren’t too tech inclined…

Ah ! that is an interesting point ! The manual reload works. Everytime? Or was it tried one or two times only?
The more information Softr team has, the better. This issue is really not a kind one, if I may say :sweat_smile:



Would it be helpful if you had custom code that lets you redirect to the home page with a querystring that forces the page to refresh?

So if your home page’s normal slug is /, then /?refresh would trigger the page to load and the immeidately refresh?

If that would help you, I’ll write it for you.

that works for me

In the meantime until I have a chance to do that, you might just play around with trying to defeat the browser cache by changing the redirect from / to /?abc=def or any other querystring that forces a page reload.

it didn’t work

@matthieu_chateau and @Schedkode is your checkout flow doing a checkout for subscription or one time payment ? (@matthieu_chateau I think yours was a subscription right ?) Can you folks DM me an example showing the full flow including the checkout ? I’m sure we tackled the one time use case and can also help with subscription too


the flow should be in images screenshot is that fine?

Yes in my case, it is a subscription.
I will let @Schedkode DM you, as in my case, it’s a client app and I can’t trigger an event for subscription for now :disappointed_relieved:.

mine also is a client app, but with an attached 14days trials so no charge eventually cos the account can be deleted after some days

so i am referring to this question here…

now the code @matthieu_chateau recommend did work for the page refresh

but here is the issue, the page keeps reloading contionusly befitting the purpose for the reloading

Let me try to adapt it (let me some time David, please :sweat_smile:, I know this should be simple, but very exciting for me)

Sorry I didn’t see this until after I posted a suggested alternative script!

If it makes you feel better, adding hacks to cause page reloads to work around problems with integrated services is a big old ANTI-PATTERN and really the right solution is to work with Softr to figure out what’s wrong on a deeper level so workarounds aren’t necessary.

Haha no problem David ! Was reading stack overflow about setTimeout then clearTimeout to refresh a page once (or just forcing refreshing the page). Everyone was saying the same, not a good practice.

1 Like