mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 22:24:11 +00:00
refactor: improve performance in rundown
- leverage compiler - correct subscriptions from zustand
This commit is contained in:
committed by
Carlos Valente
parent
0de55e74a8
commit
8e32314667
@@ -11,7 +11,8 @@ interface OverviewWrapperProps {
|
||||
}
|
||||
|
||||
export function OverviewWrapper({ navElements, children }: PropsWithChildren<OverviewWrapperProps>) {
|
||||
const { isOnline } = useIsOnline();
|
||||
const isOnline = useIsOnline();
|
||||
|
||||
return (
|
||||
<div className={cx([style.overview, !isOnline && style.isOffline])}>
|
||||
<ErrorBoundary>
|
||||
|
||||
@@ -127,7 +127,7 @@ export function StartTimes({ shouldFormat }: OverviewTimeElementsProps) {
|
||||
* Extracted to improve performance as this is a ticking value
|
||||
*/
|
||||
function RundownExpectedEnd({ shouldFormat }: OverviewTimeElementsProps) {
|
||||
const { expectedEnd } = useRundownExpectedEnd();
|
||||
const expectedEnd = useRundownExpectedEnd();
|
||||
|
||||
const [maybeExpectedEnd, maybeExpectedDaySpan] = useMemo(() => calculateEndAndDaySpan(expectedEnd), [expectedEnd]);
|
||||
const maybeExpectedEndText = (() => {
|
||||
@@ -169,7 +169,7 @@ export function MetadataTimes() {
|
||||
|
||||
function GroupTimes() {
|
||||
const { clock, mode, groupExpectedEnd, actualGroupStart, currentDay, playback } = useGroupTimerOverView();
|
||||
const { currentGroupId } = useCurrentGroupId();
|
||||
const currentGroupId = useCurrentGroupId();
|
||||
const group = useEntry(currentGroupId) as OntimeGroup | null;
|
||||
|
||||
const active = isPlaybackActive(playback);
|
||||
@@ -298,7 +298,7 @@ export function OffsetOverview() {
|
||||
}
|
||||
|
||||
export function ClockOverview({ shouldFormat, className }: OverviewTimeElementsProps & { className?: string }) {
|
||||
const { clock } = useClock();
|
||||
const clock = useClock();
|
||||
const formattedClock = shouldFormat ? formatTime(clock) : millisToString(clock);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user