Leave name empty if failed to assign at addKey

This commit is contained in:
artur
2024-02-19 14:10:15 +03:00
parent 22753a8d89
commit 06fa8ffbd7
2 changed files with 22 additions and 7 deletions

View File

@@ -60,7 +60,10 @@ export const ModalSignUp = () => {
try {
setIsLoading(true)
const k: any = await swicCall('generateKey', name)
notify(`Account created for "${name}"`, 'success')
if (k.name)
notify(`Account created for "${k.name}"`, 'success')
else
notify(`Failed to assign name "${name}", try again`, 'error')
setIsLoading(false)
setTimeout(() => {
// give frontend time to read the new key first