diff --git a/packages/desktop-client/src/components/modals/EditRuleModal.jsx b/packages/desktop-client/src/components/modals/EditRuleModal.jsx
index 8f4ffbbccfe..952c736074d 100644
--- a/packages/desktop-client/src/components/modals/EditRuleModal.jsx
+++ b/packages/desktop-client/src/components/modals/EditRuleModal.jsx
@@ -303,13 +303,15 @@ function formatAmount(amount) {
function ScheduleDescription({ id }) {
const dateFormat = useDateFormat() || 'MM/dd/yyyy';
+ const scheduleQuery = useMemo(
+ () => q('schedules').filter({ id }).select('*'),
+ [id],
+ );
const {
schedules,
statuses: scheduleStatuses,
isLoading: isSchedulesLoading,
- } = useSchedules({
- query: useMemo(() => q('schedules').filter({ id }).select('*'), [id]),
- });
+ } = useSchedules({ query: scheduleQuery });
if (isSchedulesLoading) {
return null;
diff --git a/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx b/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx
index f3bf6a846b0..bf0c83d4d75 100644
--- a/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx
@@ -33,11 +33,12 @@ export function ScheduledTransactionMenuModal({
borderTop: `1px solid ${theme.pillBorder}`,
};
const scheduleId = transactionId?.split('/')?.[1];
+ const schedulesQuery = useMemo(
+ () => q('schedules').filter({ id: scheduleId }).select('*'),
+ [scheduleId],
+ );
const { isLoading: isSchedulesLoading, schedules } = useSchedules({
- query: useMemo(
- () => q('schedules').filter({ id: scheduleId }).select('*'),
- [scheduleId],
- ),
+ query: schedulesQuery,
});
if (isSchedulesLoading) {
diff --git a/packages/desktop-client/src/components/rules/ScheduleValue.tsx b/packages/desktop-client/src/components/rules/ScheduleValue.tsx
index 27109e4e0fd..736b0378cf6 100644
--- a/packages/desktop-client/src/components/rules/ScheduleValue.tsx
+++ b/packages/desktop-client/src/components/rules/ScheduleValue.tsx
@@ -7,6 +7,8 @@ import { describeSchedule } from 'loot-core/src/shared/schedules';
import { type ScheduleEntity } from 'loot-core/src/types/models';
import { usePayees } from '../../hooks/usePayees';
+import { AnimatedLoading } from '../../icons/AnimatedLoading';
+import { View } from '../common/View';
import { Value } from './Value';
@@ -17,12 +19,15 @@ type ScheduleValueProps = {
export function ScheduleValue({ value }: ScheduleValueProps) {
const payees = usePayees();
const byId = getPayeesById(payees);
- const { schedules = [], isLoading } = useSchedules({
- query: useMemo(() => q('schedules').select('*'), []),
- });
+ const schedulesQuery = useMemo(() => q('schedules').select('*'), []);
+ const { schedules = [], isLoading } = useSchedules({ query: schedulesQuery });
if (isLoading) {
- return null;
+ return (
+