Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed Jun 19, 2024
1 parent 72bdc9f commit 6523398
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function TabContainer() {
const { viewedIndex } = useApp();

useEffect(() => {
if (!viewedIndex || id !== viewedIndex.id) return;
if (!viewedIndex) return;

if (loading) {
return;
Expand All @@ -51,9 +51,8 @@ export default function TabContainer() {
}, [viewedIndex]);

useEffect(() => {
if (!id) return;

fetchDataForNewRoute(id);
if (!viewedIndex || !viewedIndex.id) return;
fetchDataForNewRoute(viewedIndex.id);
}, [fetchDataForNewRoute]);

const renderTabContent = useCallback(() => {
Expand Down

0 comments on commit 6523398

Please sign in to comment.