Skip to content

Commit

Permalink
fix: update popup headers to show account info, ref leather-io/issues…
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Jul 24, 2024
1 parent 95d6ea5 commit 93ad45f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/app/features/container/utils/get-popup-header.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
* POPUP header logic notes here -> https://github.com/leather-io/extension/issues/4371#issuecomment-1919114939
*/
import { RouteUrls } from '@shared/route-urls';

export function isRpcRoute(pathname: RouteUrls) {
Expand All @@ -24,11 +21,14 @@ export function isRpcRoute(pathname: RouteUrls) {

export function showAccountInfo(pathname: RouteUrls) {
switch (pathname) {
case RouteUrls.PsbtRequest:
case RouteUrls.TransactionRequest:
case RouteUrls.ProfileUpdateRequest:
case RouteUrls.RpcSendTransfer:
case RouteUrls.RpcSignPsbt:
case RouteUrls.RpcSignBip322Message:
case RouteUrls.SignatureRequest:
case RouteUrls.RpcStacksSignature:
return true;
default:
return false;
Expand All @@ -39,20 +39,25 @@ export function showBalanceInfo(pathname: RouteUrls) {
switch (pathname) {
case RouteUrls.ProfileUpdateRequest:
case RouteUrls.RpcSendTransfer:
return true;
case RouteUrls.PsbtRequest:
case RouteUrls.RpcSignBip322Message:
case RouteUrls.RpcStacksSignature:
case RouteUrls.TransactionRequest:
return true;
default:
return false;
}
}

export function getDisplayAddresssBalanceOf(pathname: RouteUrls) {
// TODO it's unclear when to show ALL or STX balance here
switch (pathname) {
case RouteUrls.TransactionRequest:
case RouteUrls.ProfileUpdateRequest:
case RouteUrls.RpcSendTransfer:
case RouteUrls.PsbtRequest:
case RouteUrls.RpcSignBip322Message:
return 'all';
case RouteUrls.RpcStacksSignature:
case RouteUrls.TransactionRequest:
default:
return 'stx';
}
Expand Down

0 comments on commit 93ad45f

Please sign in to comment.