Skip to content

Commit 1a76031

Browse files
committed
refactor: do not forward undefined snap_id
1 parent af38fde commit 1a76031

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ui/components/app/wallet-overview/coin-buttons.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,15 @@ const CoinButtons = ({
202202
): { snap_id?: string } => {
203203
// Some accounts might be Snap accounts, in this case we add some extra properties
204204
// to the metrics:
205-
if (internalAccount.metadata.snap) {
205+
const snapId = internalAccount.metadata.snap?.id;
206+
if (snapId) {
206207
return {
207-
snap_id: internalAccount.metadata.snap?.id,
208+
snap_id: snapId,
208209
};
209210
}
210211

211-
// If the account is not a Snap account, then there's no extra property
212+
// If the account is not a Snap account or that we could not get the Snap ID for
213+
// some reason, we don't add any extra property.
212214
return {};
213215
};
214216

0 commit comments

Comments
 (0)