aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pages/Timer/Timer.tsx2
-rw-r--r--src/pages/Timer/TimerButton.tsx10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/pages/Timer/Timer.tsx b/src/pages/Timer/Timer.tsx
index 3ceb674..a890815 100644
--- a/src/pages/Timer/Timer.tsx
+++ b/src/pages/Timer/Timer.tsx
@@ -37,7 +37,7 @@ const Timer: React.FC<PropTypes> = ({ user, recentSolutions, setRecentSolutions,
const classes = useStyles();
const registerResult = (result: string): void => {
- const solution = { author_id: user.id, result };
+ const solution = { 'author_id': user.id, result };
post('solutions/', solution).then(response => {
setRecentSolutions([response.data].concat(recentSolutions));
});
diff --git a/src/pages/Timer/TimerButton.tsx b/src/pages/Timer/TimerButton.tsx
index 86bbf76..0a3bf38 100644
--- a/src/pages/Timer/TimerButton.tsx
+++ b/src/pages/Timer/TimerButton.tsx
@@ -37,14 +37,14 @@ const TimerButton: React.FC<PropTypes> = ({ registerResult }) => {
if (timeDelta <= 0) setMode('over');
setTime(convertTimeToString(timeDelta));
}, 10);
- return () => clearInterval(repeater);
+ return (): void => clearInterval(repeater);
}
if (mode === 'running') {
const repeater = setInterval(() => {
setTime(convertTimeToString(Date.now() - timestamp));
}, 10);
- return () => clearInterval(repeater);
+ return (): void => clearInterval(repeater);
}
if (mode === 'over') {
@@ -74,13 +74,13 @@ const TimerButton: React.FC<PropTypes> = ({ registerResult }) => {
window.addEventListener('keyup', handleKeyUp);
window.addEventListener('keypress', handleKeyPress);
- return () => {
+ return (): void => {
window.removeEventListener('keyup', handleKeyUp);
window.removeEventListener('keypress', handleKeyPress);
};
});
- const composeHelperText = () => {
+ const composeHelperText = (): string => {
switch (mode) {
case 'running': return 'Go fast!';
case 'countdown': return 'Release SPACE to begin';
@@ -89,7 +89,7 @@ const TimerButton: React.FC<PropTypes> = ({ registerResult }) => {
}
};
- const helperColor = () => {
+ const helperColor = (): 'primary' | 'secondary' | 'textSecondary' => {
switch (mode) {
case 'running': return 'primary';
case 'over': return 'secondary';