Prepare AppContainer for visibility and connectivity changes to be used for Sync#2108
Open
tomivm wants to merge 9 commits intorevert-2113-revert-2097-sync-boards-actionfrom
Open
Prepare AppContainer for visibility and connectivity changes to be used for Sync#2108tomivm wants to merge 9 commits intorevert-2113-revert-2097-sync-boards-actionfrom
tomivm wants to merge 9 commits intorevert-2113-revert-2097-sync-boards-actionfrom
Conversation
…adding data refresh logic (logs only) for logged-in users
…y changes and app visibility, adding debounce logic for sync operations
…listener management for online/offline states
…vent unnecessary updates when online/offline status is unchanged
src/components/App/App.container.js
Outdated
| return; | ||
| } | ||
|
|
||
| if (!window.navigator.onLine) { |
Collaborator
There was a problem hiding this comment.
why dont you use the isConnected redux state?
Collaborator
Author
There was a problem hiding this comment.
what is the difference?
Collaborator
There was a problem hiding this comment.
there is no difference but we have dedicated state for that, why not using it?
…the resume callback function for better readability and maintenance
…placing debounce logic for improved performance and clarity
There was a problem hiding this comment.
Pull request overview
This PR updates AppContainer to react to app visibility and connectivity changes so it can trigger a data refresh/sync flow when the user returns to the app or regains connectivity.
Changes:
- Adds online/offline listeners and cleans them up on unmount.
- Adds visibility (
visibilitychange) and Cordova resume (resume) listeners to trigger a refresh hook. - Introduces a
handleDataRefreshgate with a time-based throttle and wiresgetApiObjectsintomapDispatchToProps(currently not invoked).
…prove data refresh logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve AppContainer to handle visibility changes and resume events, incorporating data refresh logic for logged-in users. Refactor data refresh handling to include debounce logic for synchronization during connectivity changes.