@@ -12,7 +12,7 @@ import { computed } from "vue";
12
12
import { getPinyinOf } from " ../utils/hanzi" ;
13
13
import { TypingSummary } from " ../utils/summary" ;
14
14
import { followKeys , leadKeys } from " ../utils/pinyin" ;
15
- import { randInt , randomChoice } from " ../utils/number" ;
15
+ import { randInt } from " ../utils/number" ;
16
16
17
17
export interface SingleModeProps {
18
18
nextChar? : () => string ;
@@ -21,7 +21,7 @@ export interface SingleModeProps {
21
21
mode? : " Lead" | " Follow" ;
22
22
}
23
23
24
- function nextChar () {
24
+ function getNextChar () {
25
25
if (! props .mode ) {
26
26
return props .nextChar ?.() ?? " " ;
27
27
}
@@ -32,7 +32,7 @@ const pinyin = ref<string[]>([]);
32
32
33
33
const store = useStore ();
34
34
const props = defineProps <SingleModeProps >();
35
- const hanziSeq = ref (new Array (4 ).fill (0 ).map (() => nextChar ()));
35
+ const hanziSeq = ref (new Array (4 ).fill (0 ).map (() => getNextChar ()));
36
36
const isValid = ref (false );
37
37
38
38
const summary = ref (new TypingSummary ());
@@ -78,7 +78,7 @@ function onMenuChange(i: number) {
78
78
79
79
watchPostEffect (() => {
80
80
for (let i = 0 ; i < 4 ; ++ i ) {
81
- hanziSeq .value .unshift (nextChar ());
81
+ hanziSeq .value .unshift (getNextChar ());
82
82
hanziSeq .value .pop ();
83
83
}
84
84
});
@@ -132,7 +132,7 @@ function onSeq([lead, follow]: [string?, string?]) {
132
132
watchPostEffect (() => {
133
133
if (isValid .value ) {
134
134
setTimeout (() => {
135
- hanziSeq .value .unshift (nextChar ());
135
+ hanziSeq .value .unshift (getNextChar ());
136
136
hanziSeq .value .pop ();
137
137
pinyin .value = [];
138
138
isValid .value = false ;
0 commit comments