Preprocess words clientside a bit more
This commit is contained in:
parent
93610858d0
commit
f25ae50c77
|
@ -360,8 +360,10 @@ const Sidebar = ({ send, state, pState, pTeam }: GameViewProps) => {
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
const file = files[i];
|
const file = files[i];
|
||||||
const name = file.name.substring(0, file.name.lastIndexOf('.')) || file.name;
|
const name = file.name.substring(0, file.name.lastIndexOf('.')) || file.name;
|
||||||
const text = (await file.text()).trim();
|
const words = (await file.text())
|
||||||
const words = text.split('\n');
|
.split('\n')
|
||||||
|
.map((word) => word.trim())
|
||||||
|
.filter((word) => word);
|
||||||
|
|
||||||
if (words.length < 25) {
|
if (words.length < 25) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -370,7 +372,9 @@ const Sidebar = ({ send, state, pState, pTeam }: GameViewProps) => {
|
||||||
packs.push({ name, words });
|
packs.push({ name, words });
|
||||||
}
|
}
|
||||||
|
|
||||||
send.addPacks(packs);
|
if (packs.length) {
|
||||||
|
send.addPacks(packs);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in New Issue