mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-29 02:54:09 -05:00
Use isFetching instead of isPending
This commit is contained in:
@@ -39,9 +39,11 @@ export function MobileSchedulesPage() {
|
||||
const format = useFormat();
|
||||
const dateFormat = useDateFormat() || 'MM/dd/yyyy';
|
||||
|
||||
const { isPending: isSchedulesLoading, data: schedules = [] } = useSchedules({
|
||||
query: q('schedules').select('*'),
|
||||
});
|
||||
const { isFetching: isSchedulesLoading, data: schedules = [] } = useSchedules(
|
||||
{
|
||||
query: q('schedules').select('*'),
|
||||
},
|
||||
);
|
||||
const { data: { statusLookup = {} } = {} } = useScheduleStatus({ schedules });
|
||||
|
||||
const payees = usePayees();
|
||||
|
||||
@@ -44,9 +44,11 @@ export function ScheduledTransactionMenuModal({
|
||||
borderTop: `1px solid ${theme.pillBorder}`,
|
||||
};
|
||||
const scheduleId = transactionId?.split('/')?.[1];
|
||||
const { isPending: isSchedulesLoading, data: schedules = [] } = useSchedules({
|
||||
query: q('schedules').filter({ id: scheduleId }).select('*'),
|
||||
});
|
||||
const { isFetching: isSchedulesLoading, data: schedules = [] } = useSchedules(
|
||||
{
|
||||
query: q('schedules').filter({ id: scheduleId }).select('*'),
|
||||
},
|
||||
);
|
||||
|
||||
if (isSchedulesLoading) {
|
||||
return null;
|
||||
|
||||
@@ -367,9 +367,11 @@ function ScheduleDescription({ id }) {
|
||||
const { isNarrowWidth } = useResponsive();
|
||||
const dateFormat = useDateFormat() || 'MM/dd/yyyy';
|
||||
const format = useFormat();
|
||||
const { data: schedules = [], isPending: isSchedulesLoading } = useSchedules({
|
||||
query: q('schedules').filter({ id }).select('*'),
|
||||
});
|
||||
const { data: schedules = [], isFetching: isSchedulesLoading } = useSchedules(
|
||||
{
|
||||
query: q('schedules').filter({ id }).select('*'),
|
||||
},
|
||||
);
|
||||
|
||||
const {
|
||||
data: { statusLookup = {} },
|
||||
|
||||
@@ -22,11 +22,13 @@ export function ScheduleValue({ value }: ScheduleValueProps) {
|
||||
const { t } = useTranslation();
|
||||
const payees = usePayees();
|
||||
const byId = getPayeesById(payees);
|
||||
const { data: schedules = [], isPending } = useSchedules({
|
||||
query: q('schedules').select('*'),
|
||||
});
|
||||
const { data: schedules = [], isFetching: isSchedulesLoading } = useSchedules(
|
||||
{
|
||||
query: q('schedules').select('*'),
|
||||
},
|
||||
);
|
||||
|
||||
if (isPending) {
|
||||
if (isSchedulesLoading) {
|
||||
return (
|
||||
<View aria-label={t('Loading...')} style={{ display: 'inline-flex' }}>
|
||||
<AnimatedLoading width={10} height={10} />
|
||||
|
||||
@@ -41,9 +41,11 @@ export function ScheduleLink({
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const [filter, setFilter] = useState(accountName || '');
|
||||
const { isPending: isSchedulesLoading, data: schedules = [] } = useSchedules({
|
||||
query: q('schedules').filter({ completed: false }).select('*'),
|
||||
});
|
||||
const { isFetching: isSchedulesLoading, data: schedules = [] } = useSchedules(
|
||||
{
|
||||
query: q('schedules').filter({ completed: false }).select('*'),
|
||||
},
|
||||
);
|
||||
|
||||
const {
|
||||
data: { statusLookup = {} },
|
||||
|
||||
@@ -81,9 +81,11 @@ export function Schedules() {
|
||||
[],
|
||||
);
|
||||
|
||||
const { isPending: isSchedulesLoading, data: schedules = [] } = useSchedules({
|
||||
query: q('schedules').select('*'),
|
||||
});
|
||||
const { isFetching: isSchedulesLoading, data: schedules = [] } = useSchedules(
|
||||
{
|
||||
query: q('schedules').select('*'),
|
||||
},
|
||||
);
|
||||
|
||||
const { data: { statusLookup = {} } = {} } = useScheduleStatus({ schedules });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user