Trigger refresh only when initially open the track component (#704)
Due to triggering the refresh in the TrackerActiveCard it was triggered everytime this component got rendered, which was also the case when closing the track search
This commit is contained in:
@@ -29,7 +29,7 @@ import {
|
||||
} from '@mui/material';
|
||||
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
||||
import PopupState, { bindDialog, bindMenu, bindTrigger } from 'material-ui-popup-state';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { Trackers, TTrackRecord, UNSET_DATE } from '@/lib/data/Trackers.ts';
|
||||
import { ListPreference } from '@/components/sourceConfiguration/ListPreference.tsx';
|
||||
@@ -235,12 +235,6 @@ export const TrackerActiveCard = ({
|
||||
.response.catch(() => makeToast(t('global.error.label.failed_to_save_changes'), 'error'));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
requestManager
|
||||
.fetchTrackBind(trackRecord.id)
|
||||
.response.catch(() => makeToast(t('tracking.error.label.could_not_fetch_track_info'), 'error'));
|
||||
}, [trackRecord.id]);
|
||||
|
||||
return (
|
||||
<Card sx={CARD_STYLING}>
|
||||
<CardContent sx={{ padding: 0 }}>
|
||||
|
||||
Reference in New Issue
Block a user