chore(deeplink): export searchUriInArgv
This commit is contained in:
parent
b3c277f7fe
commit
955e2d2f1e
|
@ -11,6 +11,11 @@ const sendMessage = (mainWindow, url) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const searchUriInArgv = (argv: string[]): ?string => {
|
||||||
|
const argIndex = argv.findIndex(item => /zcash:(\/\/)?/.test(item));
|
||||||
|
return argv[argIndex];
|
||||||
|
};
|
||||||
|
|
||||||
export const handleDeeplink = ({
|
export const handleDeeplink = ({
|
||||||
app,
|
app,
|
||||||
mainWindow,
|
mainWindow,
|
||||||
|
@ -30,7 +35,10 @@ export const handleDeeplink = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform === 'win32' || process.platform === 'linux') {
|
if (process.platform === 'win32' || process.platform === 'linux') {
|
||||||
const argIndex = argv.findIndex(item => /zcash:(\/\/)?/.test(item));
|
const arg = searchUriInArgv(argv);
|
||||||
if (argIndex !== -1) sendMessage(mainWindow, argv[argIndex]);
|
|
||||||
|
if (arg) {
|
||||||
|
sendMessage(mainWindow, arg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue