Skip to content

Commit eb1015b

Browse files
committed
manual input rescrambles and uses correct scramble when saving
1 parent 1552479 commit eb1015b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CubeTime/Timer/StopwatchManager.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,17 @@ class StopWatchManager: ObservableObject {
186186
solveItem.penalty = penType.rawValue
187187
// .puzzle_id
188188
solveItem.session = currentSession
189-
solveItem.scramble = prevScrambleStr
189+
// Use the current scramble if stopped from manual input
190+
solveItem.scramble = time == nil ? prevScrambleStr : scrambleStr
190191
solveItem.scramble_type = currentSession.scramble_type
191192
solveItem.scramble_subtype = 0
192193
solveItem.time = self.secondsElapsed
193194
try! managedObjectContext.save()
194195

196+
// Rescramble if from manual input
197+
if time != nil {
198+
rescramble()
199+
}
195200
}
196201

197202

0 commit comments

Comments
 (0)