[Solved] Wait block waits infinitely?

Hello! I have an issue with the wait block.

In my app, I have quite a few alerts, and what I have found is that if I do not add some sort of wait block between setting the alert message and title (I use blocks to set the title and message because I don’t want to make so many alert components), then it doesn’t update in time so sometimes it has the description of the last time the alert was supposed to be set.

So I started putting wait .00000001 seconds blocks in between setting the Title and Message. It did work, but only on my phone. When I tested it on my iPad and had my friends test it, it would just wait infinitely and so the alert would never show.

I’m pretty sure it is not because I set the wait time to be too low, at least on my iPad however long I set it to still made it freeze.

If anyone knows how to help with this or if the developers can fix this problem, it would be greatly appreciated!

Post a screenshot of your alert block rules.

I could be wrong but I think about 0.03 seconds is the least amount of time that a code cycle can take.

1 Like

@mythi I’d agree with @tatiang here.

Can you try 0.1 to begin with and then halve it a couple of times until the delay is imperceptible to users, but still not crashing your iPad.

@domhnallohanlon and @tatiang thank you for responding so fast!

Here are some photos:
image


I tried using your advice and changed the wait settings to 1 second and .1, but it still doesn’t work :frowning:

Oops, forgot to mention, this is the account I (@mythi) use with my team. Sorry if there’s confusion!

Can you either post a link to your project or post another screenshot that shows the bottom of the alert block area?

Here is an extension of the second photo:

Here is a sign-in button that doesn’t work on my iPad:

So I changed accounts on my iPad and tested a different app and the wait 0.1 seconds block was working…? for example this one:

I am using FireBase for the app that doesn’t work and may be the problem but it does work on my phone so I cannot say for sure that is the problem.

Update! I believe I solved it but I am unsure why it works.

On most of my screens I have blocks to make sure the user is online (because I’m using AirTable and FireBase) that look like this:

I’m guessing the forever block slowed down the wait block on some devices because the problem is no longer happening.

Either way, thanks for you help, @tatiang and @domhnallohanlon

1 Like

could you put that on a loop? something like every 5 seconds check for internet?

put the check into a function that calls itself.