Skip to content

Conversation

@nick-stacks
Copy link
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Fixes sbtc issues on testnet
sbtc navbar link went to the mainnet sbtc page
sbtc testnet balances were 0
sbtc token page showed the token as unverified

Issue ticket number and link

Checklist:

  • I have performed a self-review of my code.
  • I have tested the change on desktop and mobile.
  • I have added thorough tests where applicable.
  • I've added analytics and error logging where applicable.

Screenshots (if appropriate):

@vercel
Copy link

vercel bot commented Oct 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
stacks-labs-explorer Ready Ready Preview Comment Oct 22, 2025 5:18pm

Comment on lines 67 to 72
export const getHasSBTCInName = (name: string, symbol: string) => {
if (!name || !symbol) {
return false;
}
return name.toLowerCase().includes('sbtc') || symbol.toLowerCase().includes('sbtc');
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guard condition here returns false if either values are falsy, but the return statement checks if either contains 'sbtc', is this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This seems logical to me. Do you think it should work differently?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this condition name.toLowerCase().includes('sbtc') || symbol.toLowerCase().includes('sbtc') says it should return true if either name or symbol contains sbtc, but the guard condition wants them both to exist, if you truly want to return true if any of name/symbol contains sbtc you should probably switch the guard condition to !name && !symbol, unless you want both to have sbtc then you can change the 2nd condition to &&

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want getHasSBTCInName ('sbtc', 'notsbtc') to return true and getHasSBTCInName ('sbtc', undefined) to return false?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants