Offline functionality
Last modified with commit 7a580a0 on
by Aljaž.
The entire app is a web app that works with an internet connection. However, parts of the application should be functional without internet connection.
Offline availability per event
Each event has its own offline toggle that lets the user choose which events are downloaded and kept available for offline use on their device.
The toggle is shown on the Event detail page to every user who can access that event. It is not restricted by role. The toggle is off by default and must be enabled manually for each event.
When the toggle is enabled:
- All data for the event is downloaded and stored locally on the device.
- The event is clearly marked as available offline.
- When the user is offline, the Events list shows only events selected for offline use.
When the toggle is disabled, the locally stored data for that event is deleted from the device.
If the event has offline changes that have not yet been synchronized with the server, such as activities started or finished while offline, the toggle cannot be disabled. The toggle remains enabled, the locally stored data is preserved, and the following toast notification is shown: “Offline način nije moguće isključiti dok se ne sinkroniziraju svi podaci.”
Example:
- Event A has the offline toggle enabled, so the event and its data are available without an internet connection.
- Event B has the offline toggle disabled, so its data is not stored locally and it is not shown in the Events list while offline.
- The user disables the offline toggle for Event A. Its local data is deleted if there are no unsynchronized changes waiting to be sent to the server.