Skip to content

Commit

Permalink
fix: issue with timer migration (#223)
Browse files Browse the repository at this point in the history
* fix: issue with timer migration
  • Loading branch information
cpvalente authored Oct 17, 2022
1 parent 766ff40 commit 2215319
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ontime-ui",
"version": "1.9.0",
"version": "1.9.1",
"private": true,
"dependencies": {
"@chakra-ui/react": "^2.3.2",
Expand Down
11 changes: 6 additions & 5 deletions client/src/features/table/TableHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import { TableSettingsContext } from '../../common/context/TableSettingsContext'
import { useFetch } from '../../common/hooks/useFetch';
import useFullscreen from '../../common/hooks/useFullscreen';
import { useTimerProvider } from '../../common/hooks/useSocketProvider';
import { formatDisplay } from '../../common/utils/dateConfig';
import { formatDisplay, millisToSeconds } from '../../common/utils/dateConfig';
import { formatTime } from '../../common/utils/time';
import { tooltipDelayFast } from '../../ontimeConfig';

import PlaybackIcon from './tableElements/PlaybackIcon';

import style from './Table.module.scss';

export default function TableHeader({handleCSVExport, featureData}) {
export default function TableHeader({ handleCSVExport, featureData }) {
const { followSelected, showSettings, toggleTheme, toggleSettings, toggleFollow } =
useContext(TableSettingsContext);
const timer = useTimerProvider();
Expand All @@ -32,11 +32,12 @@ export default function TableHeader({handleCSVExport, featureData}) {
const selected = !featureData.numEvents
? 'No events'
: `Event ${featureData.selectedEventIndex != null ? featureData.selectedEventIndex + 1 : '-'}/${
featureData.numEvents ? featureData.numEvents : '-'
}`;
featureData.numEvents ? featureData.numEvents : '-'
}`;

// prepare presentation variables
const timerNow = `${timer.running < 0 ? '-' : ''}${formatDisplay(timer.running)}`;
const isOvertime = timer.current < 0;
const timerNow = `${isOvertime ? '-' : ''}${formatDisplay(millisToSeconds(timer.current))}`;
const timeNow = formatTime(timer.clock, {
showSeconds: true,
format: 'hh:mm:ss a',
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ontime",
"version": "1.9.0",
"version": "1.9.1",
"author": "Carlos Valente",
"description": "Time keeping for live events",
"repository": "https://github.com/cpvalente/ontime",
Expand Down

0 comments on commit 2215319

Please sign in to comment.