diff --git a/packages/token-app/app/api/wallet/token-factory/route.ts b/packages/token-app/app/api/wallet/token-factory/route.ts index 173c9ee..c639245 100644 --- a/packages/token-app/app/api/wallet/token-factory/route.ts +++ b/packages/token-app/app/api/wallet/token-factory/route.ts @@ -43,7 +43,7 @@ export async function GET(request: NextRequest) { const contractId = jsActive.createdEvent.contractId; const instrumentId = createArg.instrumentId; - const nameMatch = instrumentId.match(/^[^#]+#(.+)$/); + const nameMatch = /^[^#]+#(.+)$/.exec(instrumentId); const name = nameMatch ? nameMatch[1] : instrumentId; return { diff --git a/packages/token-app/components/BalancesView.tsx b/packages/token-app/components/BalancesView.tsx index c38f51b..a6e4c65 100644 --- a/packages/token-app/components/BalancesView.tsx +++ b/packages/token-app/components/BalancesView.tsx @@ -21,7 +21,7 @@ export function BalancesView({ partyId, instruments }: BalancesViewProps) { ); const name = instrument?.name || - instrumentId.match(/^[^#]+#(.+)$/)?.[1] || + /^[^#]+#(.+)$/.exec(instrumentId)?.[1] || instrumentId; return { admin, total: balance.total, instrumentName: name }; }) diff --git a/packages/token-app/components/CustodianView.tsx b/packages/token-app/components/CustodianView.tsx index 14b3da6..37d647b 100644 --- a/packages/token-app/components/CustodianView.tsx +++ b/packages/token-app/components/CustodianView.tsx @@ -479,8 +479,8 @@ export function CustodianView({ partyId, partyName }: CustodianViewProps) { ); const instrumentName = requestInstrument?.name || - requestInstrumentId.match( - /^[^#]+#(.+)$/ + /^[^#]+#(.+)$/.exec( + requestInstrumentId )?.[1] || requestInstrumentId; const amount = Number(request.transfer.amount); diff --git a/packages/token-app/components/PartyView.tsx b/packages/token-app/components/PartyView.tsx index 8953a7d..9cf6301 100644 --- a/packages/token-app/components/PartyView.tsx +++ b/packages/token-app/components/PartyView.tsx @@ -132,7 +132,7 @@ export function PartyView({