fix(bip39-generator): cleared an issue with the mnemonic validation
This commit is contained in:
		
							parent
							
								
									e48d60b1ed
								
							
						
					
					
						commit
						ca7cb44389
					
				| @ -59,24 +59,24 @@ | |||||||
| 
 | 
 | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { useCopy } from '@/composable/copy'; | import { useCopy } from '@/composable/copy'; | ||||||
| import { ref, computed } from 'vue'; | import { useValidation } from '@/composable/validation'; | ||||||
| import { | import { | ||||||
|   entropyToMnemonic, |  | ||||||
|   englishWordList, |  | ||||||
|   chineseSimplifiedWordList, |   chineseSimplifiedWordList, | ||||||
|   chineseTraditionalWordList, |   chineseTraditionalWordList, | ||||||
|   czechWordList, |   czechWordList, | ||||||
|  |   englishWordList, | ||||||
|  |   entropyToMnemonic, | ||||||
|   frenchWordList, |   frenchWordList, | ||||||
|  |   generateEntropy, | ||||||
|   italianWordList, |   italianWordList, | ||||||
|   japaneseWordList, |   japaneseWordList, | ||||||
|   koreanWordList, |   koreanWordList, | ||||||
|  |   mnemonicToEntropy, | ||||||
|   portugueseWordList, |   portugueseWordList, | ||||||
|   spanishWordList, |   spanishWordList, | ||||||
|   generateEntropy, |  | ||||||
|   mnemonicToEntropy, |  | ||||||
| } from '@it-tools/bip39'; | } from '@it-tools/bip39'; | ||||||
| import { Copy, Refresh } from '@vicons/tabler'; | import { Copy, Refresh } from '@vicons/tabler'; | ||||||
| import { useValidation } from '@/composable/validation'; | import { computed, ref } from 'vue'; | ||||||
| 
 | 
 | ||||||
| const languages = { | const languages = { | ||||||
|   English: englishWordList, |   English: englishWordList, | ||||||
| @ -134,7 +134,7 @@ const mnemonicValidation = useValidation({ | |||||||
|     { |     { | ||||||
|       validator: (value) => { |       validator: (value) => { | ||||||
|         try { |         try { | ||||||
|           mnemonicToEntropy(value); |           mnemonicToEntropy(value, languages[language.value]); | ||||||
|           return true; |           return true; | ||||||
|         } catch (_) { |         } catch (_) { | ||||||
|           return false; |           return false; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user