Skip to content

Commit 0813e43

Browse files
committed
refactor: rm intermediate variable
1 parent 8546c0b commit 0813e43

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/components/Quiz/useLocalQuizData.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ export const useLocalQuizData = () => {
1717
// `completed` value from a string to an object.
1818
const [current, setCurrent] = data
1919
if (typeof current.completed === "string") {
20-
const newCompleted = JSON.parse(current.completed)
21-
setCurrent({ ...current, completed: newCompleted })
20+
setCurrent({ ...current, completed: JSON.parse(current.completed) })
2221
}
2322

2423
return data

0 commit comments

Comments
 (0)