mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 22:49:18 +00:00
refactor: remove unused data
This commit is contained in:
committed by
Carlos Valente
parent
ef906f43d7
commit
66a4e27fdd
-14
@@ -14,7 +14,6 @@ import { colourToHex, cssOrHexToColour } from 'ontime-utils';
|
|||||||
|
|
||||||
import { RUNDOWN } from '../../../../common/api/constants';
|
import { RUNDOWN } from '../../../../common/api/constants';
|
||||||
import { useSelectedEventId } from '../../../../common/hooks/useSocket';
|
import { useSelectedEventId } from '../../../../common/hooks/useSocket';
|
||||||
import { lazyEvaluate } from '../../../../common/utils/lazyEvaluate';
|
|
||||||
import { getAccessibleColour } from '../../../../common/utils/styleUtils';
|
import { getAccessibleColour } from '../../../../common/utils/styleUtils';
|
||||||
import { usePersistedCuesheetOptions } from '../../cuesheet.options';
|
import { usePersistedCuesheetOptions } from '../../cuesheet.options';
|
||||||
|
|
||||||
@@ -36,17 +35,6 @@ export default function CuesheetBody({ rowModel, selectedRef, table }: CuesheetB
|
|||||||
const hidePast = usePersistedCuesheetOptions((state) => state.hidePast);
|
const hidePast = usePersistedCuesheetOptions((state) => state.hidePast);
|
||||||
const hideDelays = usePersistedCuesheetOptions((state) => state.hideDelays);
|
const hideDelays = usePersistedCuesheetOptions((state) => state.hideDelays);
|
||||||
|
|
||||||
const getVisibleColumns = lazyEvaluate(() => table.getVisibleFlatColumns());
|
|
||||||
const getColumnHash = lazyEvaluate(() => {
|
|
||||||
let columnHash = '';
|
|
||||||
const columns = getVisibleColumns();
|
|
||||||
|
|
||||||
for (let i = 0; i < columns.length; i++) {
|
|
||||||
columnHash += `${columns[i].getIndex()}-${columns[i].getSize()} `;
|
|
||||||
}
|
|
||||||
return columnHash;
|
|
||||||
});
|
|
||||||
|
|
||||||
let eventIndex = 0;
|
let eventIndex = 0;
|
||||||
// for the first event, it will be past if there is something selected
|
// for the first event, it will be past if there is something selected
|
||||||
let isPast = Boolean(selectedEventId);
|
let isPast = Boolean(selectedEventId);
|
||||||
@@ -140,7 +128,6 @@ export default function CuesheetBody({ rowModel, selectedRef, table }: CuesheetB
|
|||||||
if (isOntimeEvent(entry)) {
|
if (isOntimeEvent(entry)) {
|
||||||
eventIndex++;
|
eventIndex++;
|
||||||
const isSelected = key === selectedEventId;
|
const isSelected = key === selectedEventId;
|
||||||
const columnHash = getColumnHash();
|
|
||||||
|
|
||||||
if (isPast && hidePast) {
|
if (isPast && hidePast) {
|
||||||
return null;
|
return null;
|
||||||
@@ -185,7 +172,6 @@ export default function CuesheetBody({ rowModel, selectedRef, table }: CuesheetB
|
|||||||
parentBgColour={parentBgColour}
|
parentBgColour={parentBgColour}
|
||||||
table={table}
|
table={table}
|
||||||
firstAfterBlock={firstAfterBlock}
|
firstAfterBlock={firstAfterBlock}
|
||||||
columnHash={columnHash}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ interface EventRowProps {
|
|||||||
rowBgColour?: string;
|
rowBgColour?: string;
|
||||||
parentBgColour?: string;
|
parentBgColour?: string;
|
||||||
table: Table<OntimeEntry>;
|
table: Table<OntimeEntry>;
|
||||||
/** hack to force re-rendering of the row when the column sizes change */
|
|
||||||
columnHash: string;
|
|
||||||
firstAfterBlock: boolean;
|
firstAfterBlock: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user