forked from cerc-io/laconic-wallet
Fix intents path to use namespace and chainId (#92)
This commit is contained in:
parent
3809ce88b1
commit
984cad8e48
2
index.js
2
index.js
@ -17,7 +17,7 @@ export default function Main() {
|
|||||||
config: {
|
config: {
|
||||||
screens: {
|
screens: {
|
||||||
SignRequest: {
|
SignRequest: {
|
||||||
path: 'sign/:network/:address/:message',
|
path: 'sign/:namespace/:chaindId/:address/:message',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -103,12 +103,13 @@ const SignRequest = ({ route }: SignRequestProps) => {
|
|||||||
|
|
||||||
const sanitizePath = useCallback(
|
const sanitizePath = useCallback(
|
||||||
(path: string) => {
|
(path: string) => {
|
||||||
const regex = /^\/sign\/(eip155|cosmos)\/(.+)\/(.+)$/;
|
const regex = /^\/sign\/(eip155|cosmos)\/(.+)\/(.+)\/(.+)$/;
|
||||||
const match = path.match(regex);
|
const match = path.match(regex);
|
||||||
if (match) {
|
if (match) {
|
||||||
const [, network, address, message] = match;
|
const [, namespace, chainId, address, message] = match;
|
||||||
return {
|
return {
|
||||||
network,
|
namespace,
|
||||||
|
chainId,
|
||||||
address,
|
address,
|
||||||
message,
|
message,
|
||||||
};
|
};
|
||||||
@ -125,9 +126,8 @@ const SignRequest = ({ route }: SignRequestProps) => {
|
|||||||
const sanitizedRoute = sanitizePath(route.path);
|
const sanitizedRoute = sanitizePath(route.path);
|
||||||
sanitizedRoute &&
|
sanitizedRoute &&
|
||||||
retrieveData(
|
retrieveData(
|
||||||
sanitizedRoute.network,
|
sanitizedRoute.namespace,
|
||||||
// TODO: Take chainId from route.path
|
sanitizedRoute.chainId,
|
||||||
selectedNetwork!.chainId!,
|
|
||||||
sanitizedRoute.address,
|
sanitizedRoute.address,
|
||||||
sanitizedRoute.message,
|
sanitizedRoute.message,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user