How to check no internet in Reactive web
Question
Application Type
Reactive

How we can get to know in reactive web if browser is not connected with internet.

Hi KUNDAN CHAUHAN,

I am currently using navigator.online but sometime it gives me true even there is network has been off.
Looking for other alternatives.

Thanks.

@Pankaj Jain

Have you got the solution on your question? if not then I am sharing you one discussion LINK might this help you 


Thanks,

Shriyash

Hi Shriyansh,

The given solution is for Mobile but problem is for reactive web. Although I am maintaining the client variable but when I use GetNetworkStatus sometimes it does not gives the accurate status of Network. 

Thanks
Pankaj.

Hi @Pankaj Jain,

You can use Client Action named "GetNetworkStatus()" it will return true if you are online otherwise return false.

OR You can check this forge component which uses this client action as well as JavaScript with no external dependencies.

Best Regards,

Rasika

Hello 

You can achieve this with JavaScript Asynchronously

Code Snippet

window.addEventListener("offline", (event) => {  const statusDisplay = document.getElementById("status");  statusDisplay.textContent = "OFFline";});

window.addEventListener("online", (event) => {  const statusDisplay = document.getElementById("status");  statusDisplay.textContent = "Online";});


Also we have a UI component You have to take the dependencies for OutSystems UI



I Hope This Helps

Thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.