Skip to content

Commit

Permalink
[ui] Sensor history: Fix tick ID variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hellendag committed Aug 21, 2024
1 parent 6d78319 commit ff263ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const TickDetailsDialog = ({tickId, isOpen, instigationSelector, onClose}
};

interface InnerProps {
tickId: number | undefined;
tickId: string | undefined;
instigationSelector: InstigationSelector;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ export const TickHistoryTimeline = ({
afterTimestamp?: number;
statuses?: InstigationTickStatus[];
}) => {
const [selectedTickId, setSelectedTickId] = useQueryPersistedState<number | undefined>({
const [selectedTickId, setSelectedTickId] = useQueryPersistedState<string | undefined>({
encode: (tickId) => ({tickId}),
decode: (qs) => (qs['tickId'] ? Number(qs['tickId']) : undefined),
decode: (qs) => qs['tickId'] ?? undefined,
});

const [pollingPaused, pausePolling] = React.useState<boolean>(false);
Expand Down Expand Up @@ -364,7 +364,7 @@ export const TickHistoryTimeline = ({
const {ticks = []} = data.instigationStateOrError;

const onTickClick = (tick?: InstigationTick) => {
setSelectedTickId(tick ? Number(tick.tickId) : undefined);
setSelectedTickId(tick ? tick.tickId : undefined);
};

const onTickHover = (tick?: InstigationTick) => {
Expand All @@ -376,6 +376,7 @@ export const TickHistoryTimeline = ({
pausePolling(true);
}
};

return (
<>
<TickDetailsDialog
Expand Down Expand Up @@ -512,7 +513,7 @@ function TickRow({
) : null}
<TickDetailsDialog
isOpen={showResults}
tickId={Number(tick.tickId)}
tickId={tick.tickId}
instigationSelector={instigationSelector}
onClose={() => {
setShowResults(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const TickTagForRun = ({instigationSelector, instigationType, tickId}: Pr
isOpen={isOpen}
onClose={() => setIsOpen(false)}
instigationSelector={instigationSelector}
tickId={Number(tickId)}
tickId={tickId}
/>
</>
);
Expand Down

0 comments on commit ff263ac

Please sign in to comment.