Skip to content

Commit

Permalink
Include displayName and networkLocation in add/edit token logging
Browse files Browse the repository at this point in the history
  • Loading branch information
peachbits committed Oct 2, 2024
1 parent ccfa3d4 commit b82606f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- changed: Add display name and network location to add/edit token logs

## 4.15.0

- added: Add Maya Protocol
Expand Down
9 changes: 8 additions & 1 deletion src/components/scenes/EditTokenScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,15 @@ function EditTokenSceneComponent(props: Props) {
networkLocation
}

function logMessage(action: string, tokenId: string): string {
return `${action} Custom Token: ${account.username} -- ${getWalletName(wallet)} -- ${
wallet.type
} -- ${tokenId} -- ${displayName} -- ${currencyCode} -- ${decimals} -- ${JSON.stringify(customTokenInput.networkLocation)}`
}

if (tokenId != null) {
await wallet.currencyConfig.changeCustomToken(tokenId, customTokenInput)
logActivity(logMessage('Edit', tokenId))
navigation.goBack()
} else {
// Creating a new token
Expand Down Expand Up @@ -181,7 +188,7 @@ function EditTokenSceneComponent(props: Props) {
}

await wallet.changeEnabledTokenIds([...wallet.enabledTokenIds, newTokenId])
logActivity(`Add Custom Token: ${account.username} -- ${getWalletName(wallet)} -- ${wallet.type} -- ${newTokenId} -- ${currencyCode} -- ${decimals}`)
logActivity(logMessage('Add', newTokenId))
}
navigation.goBack()
}
Expand Down

0 comments on commit b82606f

Please sign in to comment.