I have created an offline PWA with Outsystems.The app is working fine both online and offline.But I need to have a toggle button where I can switch to offline mode even if I have an internet connection.Is that possible?
Then the preferred way is to have a client variable to store the Offline/Online preferred setting (could be a boolean)
Create a toggle (in a settings page, or somewhere in the footer/header/menu) toggling this client variable between these online/offline states (in case of the boolean, between True/False)
Then you can disable buttons and check within the logic flow on the value of this client variable and act accordingly (every call to the server should be protected with this client variable check, this otherwise could trigger a connection timeout Exception)
Is this for testing purposes? Because Chrome Developer Tools (F12) has an option to disable your internet.
Hi @Geertjan Jacobs Its not for testing purposes. We are trying to add a feature where, if the internet connection is not stable, the user can click the toggle button to go offline and use the app offline