mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-24 08:29:14 +00:00
refactor: defer table while loading
This commit is contained in:
committed by
Carlos Valente
parent
4a16378786
commit
8e7ab54d39
@@ -23,8 +23,8 @@ import styles from './CuesheetPage.module.scss';
|
|||||||
|
|
||||||
export default function CuesheetPage() {
|
export default function CuesheetPage() {
|
||||||
// TODO: can we use the normalised rundown for the table?
|
// TODO: can we use the normalised rundown for the table?
|
||||||
const { data: flatRundown } = useFlatRundown();
|
const { data: flatRundown, status: rundownStatus } = useFlatRundown();
|
||||||
const { data: customFields } = useCustomFields();
|
const { data: customFields, status: customFieldStatus } = useCustomFields();
|
||||||
const { showEditFormDrawer, isViewLocked } = useViewEditor({ isLockable: true });
|
const { showEditFormDrawer, isViewLocked } = useViewEditor({ isLockable: true });
|
||||||
const { isOpen: isMenuOpen, onOpen, onClose } = useDisclosure();
|
const { isOpen: isMenuOpen, onOpen, onClose } = useDisclosure();
|
||||||
const { isOpen: isEventEditorOpen, onOpen: onEventEditorOpen, onClose: onEventEditorClose } = useDisclosure();
|
const { isOpen: isEventEditorOpen, onOpen: onEventEditorOpen, onClose: onEventEditorClose } = useDisclosure();
|
||||||
@@ -50,7 +50,7 @@ export default function CuesheetPage() {
|
|||||||
[onEventEditorClose, onEventEditorOpen],
|
[onEventEditorClose, onEventEditorOpen],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!customFields || !flatRundown) {
|
if (!customFields || !flatRundown || rundownStatus === 'pending' || customFieldStatus === 'pending') {
|
||||||
return <EmptyPage text='Loading...' />;
|
return <EmptyPage text='Loading...' />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user