OBPIH-6944 Content refreshes twice when switching tabs#5052
Merged
awalkowiak merged 4 commits intodevelopfrom Feb 18, 2025
Merged
OBPIH-6944 Content refreshes twice when switching tabs#5052awalkowiak merged 4 commits intodevelopfrom
awalkowiak merged 4 commits intodevelopfrom
Conversation
alannadolny
reviewed
Feb 17, 2025
src/js/hooks/useTableDataV2.js
Outdated
| // to prevent unnecessary API calls when switching between tabs | ||
| useEffect(() => { | ||
| if (shouldFetch) { | ||
| if (shouldFetch && tab === filterParams.tab) { |
Collaborator
There was a problem hiding this comment.
you should use this condition when passing shouldFetch. It's the idea of this property.
Collaborator
There was a problem hiding this comment.
Remember that this hook should be reusable, so what happens when we don't have tabs? that's the additional reason for shouldFetch
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5052 +/- ##
============================================
- Coverage 7.88% 7.84% -0.04%
+ Complexity 884 876 -8
============================================
Files 625 625
Lines 42813 42813
Branches 10376 10376
============================================
- Hits 3375 3358 -17
- Misses 38933 38952 +19
+ Partials 505 503 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e331886 to
fe50d3d
Compare
kchelstowski
approved these changes
Feb 17, 2025
SebastianLib
added a commit
that referenced
this pull request
Feb 19, 2025
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.
✨ Description of Change
Link to GitHub issue or Jira ticket:
Description:
📷 Screenshots & Recordings (optional)