Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Configure/Configure.js
Show First 20 Lines • Show All 637 Lines • ▼ Show 20 Lines | useEffect(async () => { | ||||
duplicateContact = true; | duplicateContact = true; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
// in the edge case of a fresh new wallet on a fresh new browser, remove the initialization entry to avoid an undefined contact in array | // in the edge case of a fresh new wallet on a fresh new browser, remove the initialization entry to avoid an undefined contact in array | ||||
if ( | if ( | ||||
tempContactListArray && | tempContactListArray && | ||||
tempContactListArray[0].address === undefined | typeof tempContactListArray[0].address === 'undefined' | ||||
) { | ) { | ||||
tempContactListArray.shift(); | tempContactListArray.shift(); | ||||
} | } | ||||
// if address does not exist on the contact list, add it | // if address does not exist on the contact list, add it | ||||
if (!duplicateContact) { | if (!duplicateContact) { | ||||
tempContactListArray.push(newContactObj); | tempContactListArray.push(newContactObj); | ||||
generalNotification( | generalNotification( | ||||
Show All 34 Lines | useEffect(async () => { | ||||
} catch (err) { | } catch (err) { | ||||
console.log('Error in getContactListFromLocalForage()'); | console.log('Error in getContactListFromLocalForage()'); | ||||
console.log(err); | console.log(err); | ||||
} | } | ||||
// in the edge case of a fresh new wallet on a fresh new browser, remove the initialization entry to avoid an undefined contact in array | // in the edge case of a fresh new wallet on a fresh new browser, remove the initialization entry to avoid an undefined contact in array | ||||
if ( | if ( | ||||
loadContactListStatus && | loadContactListStatus && | ||||
loadContactListStatus[0].address === undefined | typeof loadContactListStatus[0].address === 'undefined' | ||||
) { | ) { | ||||
loadContactListStatus.shift(); | loadContactListStatus.shift(); | ||||
} | } | ||||
setContactListArray(loadContactListStatus); | setContactListArray(loadContactListStatus); | ||||
} | } | ||||
}, []); | }, []); | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | const changeWalletName = async () => { | ||||
walletToBeRenamed.name, | walletToBeRenamed.name, | ||||
newWalletName, | newWalletName, | ||||
); | ); | ||||
} | } | ||||
if (renameSuccess) { | if (renameSuccess) { | ||||
Modal.success({ | Modal.success({ | ||||
content: `Wallet "${ | content: `Wallet "${ | ||||
oldActiveWalletName !== undefined | typeof oldActiveWalletName !== 'undefined' | ||||
? oldActiveWalletName | ? oldActiveWalletName | ||||
: walletToBeRenamed.name | : walletToBeRenamed.name | ||||
}" renamed to "${newWalletName}"`, | }" renamed to "${newWalletName}"`, | ||||
}); | }); | ||||
} else { | } else { | ||||
Modal.error({ | Modal.error({ | ||||
content: `Rename failed. All wallets must have a unique name.`, | content: `Rename failed. All wallets must have a unique name.`, | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 1,137 Lines • Show Last 20 Lines |