It’s actually quite a bit harder than it looks. I think you are best off going back to the first solution with (ionChange)
and manually guarding against the problem of it being called too often. See this thread.
2 Likes