How to hide loading spinner on a specific form?

What I’m trying to do:
I want to hide the loading spinner when I am on a specific form.

What I’ve tried and what’s not working:
I have a Dashboard form in my app, it has a timer, which fetches data using a server.call_s() every 30 sec.
I know call_s() suppresses the spinner for the server call. But in my case it still shows up for a split second. I guess when i’m updating UI only then it shows up.

I have tried to add a custom-role for my Dashboard form like this:

.anvil-role-no-spinner{
   #loadingSpinner{
      display:none;
   }
}

I guess #loadingSpinner is out of scope of my Dashboard Form.

Any help?

There is an alternative in the docs using a with block. Not sure if it will help but here is the link

https://anvil.works/docs/server#suppressing-the-spinner

1 Like
with anvil.server.no_loading_indicator:
    anvil.server.call("guess", n)

is equivalent to anvil.server.call_s("guess", n) which I have already tried.

Have you tried nesting the UI update inside the with block too?

The with statement should suppress the loading spinner for all the statements within it - so it’s more powerful than just using the call_s option.

1 Like

Hey thanks! that worked like a charm! now i don’t know why call_s even exists!