Show log in form above alert

What I’m trying to do:
I would like to have the option to prevent session expiries by “locking the session” until the person logs in without things in the background (like a heartbeat function or timers making calls to the server to check statuses) being paused. The idea being that the app keeps updating things in the background but the user can’t do anything while the app is “locked”.
When they enter their password, the app unlocks.

I am trying to find a solution that doesn’t involve me adding a popover element to each form that gets shown in an alert. I am also trying to avoid having to reset the session manually.

What I’ve tried and what’s not working:
I have tried using an alert but that doesn’t work if another alert is already open.
Popovers also wont work from the main form since the alert waits until the alert is closed before running any code.
Notifications won’t block the popover from showing but also won’t show while an alert is there.

I have also thought about trying to check whether an alert is currently open but I am not sure about how to approach this.

Any ideas?

If your own code is the only source of alerts, then you might wrap the standard alert call with a function of your own. That function could do the desired bookkeeping.

1 Like

Thanks for the idea @p.colbert this would work.
The only issue I can think of would be if an alert was open with some work in progress I would need to catch and store that as well as the point of operation… could get tricky.

I wonder if the easier option might be to add a popover to a common component in each form so that I can call it without interrupting the workflow… I will give it some more thought