fix: dict filename error & fix set dict tag error

This commit is contained in:
KaiyiWing
2023-04-24 16:38:29 +08:00
parent ebc7780edc
commit 2e27c71d67
4 changed files with 7 additions and 4 deletions

View File

@@ -29,9 +29,12 @@ export default function DictionaryGroup({ groupedDictsByTag }: { groupedDictsByT
useEffect(() => {
const commonTags = findCommonValues(tagList, currentDictInfo.tags)
setCurrentTag(commonTags[0])
if (commonTags.length > 0) {
setCurrentTag(commonTags[0])
}
}, [currentDictInfo.tags, tagList])
console.log(groupedDictsByTag[currentTag], groupedDictsByTag, currentTag)
return (
<div>
<DictTagSwitcher tagList={tagList} currentTag={currentTag} onChangeCurrentTag={onChangeCurrentTag} />

View File

@@ -107,7 +107,7 @@ const chinaExam: DictionaryResource[] = [
description: 'common suffix',
category: '中国考试',
tags: ['其他'],
url: '/dicts/suffix word.json',
url: '/dicts/suffix_word.json',
length: 126,
language: 'en',
languageCategory: 'en',
@@ -118,8 +118,8 @@ const chinaExam: DictionaryResource[] = [
description: 'common roots',
category: '中国考试',
tags: ['其他'],
url: '/dicts/word roots1.json',
length: 368,
url: '/dicts/word_roots1.json',
length: 369,
language: 'en',
languageCategory: 'en',
},