mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-18 13:47:08 -04:00
Render keyword examples in the user language
This commit is contained in:
@@ -91,8 +91,8 @@ export const WORDS: string[] = [
|
||||
"Finance",
|
||||
]
|
||||
|
||||
function getRandomPair(count = 3): string {
|
||||
const shuffled = [...WORDS].sort(() => 0.5 - Math.random())
|
||||
function getRandomPair(words = WORDS, count = 3): string {
|
||||
const shuffled = [...words].sort(() => 0.5 - Math.random())
|
||||
return shuffled.slice(0, count).join(", ")
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ export const Search = (props: {
|
||||
setTimeout(() => {
|
||||
setPlaceholder('');
|
||||
setCharIndex(0);
|
||||
setTextToType(getRandomPair()); // pick new pair
|
||||
setTextToType(getRandomPair(Object.values(interestChoices))); // pick new pair
|
||||
setIsHolding(false);
|
||||
}, HOLD_TIME);
|
||||
return prev;
|
||||
|
||||
Reference in New Issue
Block a user