Skip to content

Commit

Permalink
rely on Suspense for load
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-tvu committed Dec 19, 2023
1 parent d2568cd commit f11f662
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions web/src/app/schedules/ScheduleRuleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { ruleSummary } from './util'
import ScheduleRuleEditDialog from './ScheduleRuleEditDialog'
import ScheduleRuleDeleteDialog from './ScheduleRuleDeleteDialog'
import { GenericError } from '../error-pages'
import Spinner from '../loading/components/Spinner'
import { DateTime } from 'luxon'
import { useScheduleTZ } from './useScheduleTZ'
import { useIsWidthDown } from '../util/useWidth'
Expand Down Expand Up @@ -60,7 +59,7 @@ export default function ScheduleRuleList(
const [createType, setCreateType] = useState<TargetType | null>(null)
const isMobile = useIsWidthDown('md')

const [{ data, fetching, error }] = useQuery({
const [{ data, error }] = useQuery({
query,
variables: { id: scheduleID },
})
Expand All @@ -71,10 +70,6 @@ export default function ScheduleRuleList(
return <GenericError error={error.message} />
}

if (fetching && !data) {
return <Spinner />
}

function renderSubText(rules: ScheduleRule[], timeZone: string): JSX.Element {
const tzSummary = ruleSummary(rules, timeZone, timeZone)
const tzAbbr = DateTime.local({ zone: timeZone }).toFormat('ZZZZ')
Expand Down

0 comments on commit f11f662

Please sign in to comment.