File tree Expand file tree Collapse file tree 5 files changed +5
-8
lines changed Expand file tree Collapse file tree 5 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,9 @@ export default function ModalSolve({ currentTab }: { currentTab: SolveTab }) {
182
182
className = "w-full h-32 my-3"
183
183
show = { status }
184
184
scramble = { solve . scramble }
185
- event = { solve ? solve . category : "3x3" }
185
+ event = {
186
+ solve && selectedCube ? selectedCube . category : "3x3"
187
+ }
186
188
> </ ScrambleDisplay >
187
189
) }
188
190
< div > { solve . comment } </ div >
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ export default function ManualMode() {
57
57
dnf : false ,
58
58
plus2 : false ,
59
59
rating : Math . floor ( Math . random ( ) * 20 ) + scramble . length ,
60
- category : selectedCube . category ,
61
60
cubeId : selectedCube . id ,
62
61
} ;
63
62
setLastSolve ( newSolve ) ;
Original file line number Diff line number Diff line change @@ -134,7 +134,6 @@ export default function useTimer() {
134
134
dnf : false ,
135
135
plus2 : false ,
136
136
rating : Math . floor ( Math . random ( ) * 20 ) + scramble . length ,
137
- category : selectedCube . category ,
138
137
cubeId : selectedCube . id ,
139
138
comment : "" ,
140
139
} ;
Original file line number Diff line number Diff line change 1
- import { Categories } from "./Categories" ;
2
-
3
1
export interface Solve {
4
2
id : string ;
5
3
cubeId : string ;
@@ -11,6 +9,5 @@ export interface Solve {
11
9
rating : number ;
12
10
dnf : boolean ;
13
11
plus2 : boolean ;
14
- category : Categories ;
15
12
comment ?: string ;
16
13
}
Original file line number Diff line number Diff line change 1
1
import { Cube } from "@/interfaces/Cube" ;
2
2
import { ChangeEvent } from "react" ;
3
3
import genId from "./genId" ;
4
+ import { Solve } from "@/interfaces/Solve" ;
4
5
5
6
export default function importDataFromFile (
6
7
event : ChangeEvent < HTMLInputElement >
@@ -116,7 +117,7 @@ function isValidCubesData(uploadedFileData: string): boolean {
116
117
console . log ( endTime - solvingTime , endTime , solvingTime ) ;
117
118
118
119
// adjust the calculations trying to match the data structure
119
- const newSolve = {
120
+ const newSolve : Solve = {
120
121
id : genId ( ) ,
121
122
startTime : endTime - solvingTime ,
122
123
endTime : endTime ,
@@ -126,7 +127,6 @@ function isValidCubesData(uploadedFileData: string): boolean {
126
127
dnf : hasDNF ,
127
128
plus2 : plus2 ,
128
129
rating : Math . floor ( Math . random ( ) * 20 ) + scramble . length ,
129
- category : newCube . category ,
130
130
cubeId : newCube . id ,
131
131
comment : comment ,
132
132
} ;
You can’t perform that action at this time.
0 commit comments