Skip to content

Commit 7b99131

Browse files
committed
Merge branch 'dev'
2 parents 6cf52c7 + 8b4ede6 commit 7b99131

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/app/(app)/settings/components/settings-preview-simulator.tsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@ export function SettingsPreviewSimulator({
4141

4242
useEventListener(
4343
'dblclick',
44-
scrambleOnUnscramble,
44+
scrambleOrUnscramble,
4545
simulatorRef as RefObject<HTMLDivElement>,
4646
)
4747

4848
useEventListener('keydown', (event) => {
4949
if (event.key === ' ') {
50-
scrambleOnUnscramble()
50+
scrambleOrUnscramble()
5151
}
5252

5353
if (!isDirty && !isRotation(event)) setIsDirty(true)
5454
applyKeyboardMove(event)
5555
})
5656

57-
function scrambleOnUnscramble() {
57+
function scrambleOrUnscramble() {
5858
if (isDirty) {
5959
setScramble(scramble === '' ? ' ' : '') // HACK: a little hack to trigger a scramble update (changing it form '' to '' wouldn't do anything)
6060
} else {
@@ -93,8 +93,21 @@ export function SettingsPreviewSimulator({
9393
}
9494

9595
function badRandomScramble() {
96-
const MOVES = ['R', 'U', 'F', 'B', 'L', 'D']
97-
return Array.from({ length: 20 })
96+
const MOVES = [
97+
'R',
98+
'U',
99+
'F',
100+
'B',
101+
'L',
102+
'D',
103+
'Rw',
104+
'Uw',
105+
'Fw',
106+
'Bw',
107+
'Lw',
108+
'Dw',
109+
]
110+
return Array.from({ length: 30 })
98111
.map(() => MOVES[Math.floor(Math.random() * MOVES.length)])
99112
.join(' ')
100113
}

0 commit comments

Comments
 (0)