fix app launching using custom URL scheme
This commit is contained in:
parent
db9ad36627
commit
625a9dc0e4
|
|
@ -7,7 +7,7 @@ import FalconCardHeader from '../common/FalconCardHeader';
|
|||
const JKCustomUrlSchemaHandle = () => {
|
||||
const [urlScheme, setUrlScheme] = useState(null);
|
||||
const { t } = useTranslation();
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const queryStr = window.location.search;
|
||||
if (!queryStr) return;
|
||||
|
|
@ -32,11 +32,17 @@ const JKCustomUrlSchemaHandle = () => {
|
|||
<CardBody className="pt-0">
|
||||
<Row>
|
||||
<Col>
|
||||
<div className='pt-5 text-center pb-5'>
|
||||
<div className="mt-8 text-center mb-8">
|
||||
{urlScheme && (
|
||||
<p>
|
||||
If JamKazam app doesn't open automatically, <a href={urlScheme}>click here</a>.
|
||||
</p>
|
||||
<>
|
||||
<p>
|
||||
Click <strong>Open JamKazam.app</strong> on the dialog shown by the browser. <br />
|
||||
If you don't see the dialog, click <strong>Lauhch JamKazam App</strong> below.
|
||||
</p>
|
||||
<div>
|
||||
<a href={urlScheme} className='btn btn-primary'>Lauhch JamKazam App</a>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</Col>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ export default (section, queryStr) => {
|
|||
if(queryStr.startsWith('?')) {
|
||||
queryStr = queryStr.substring(1);
|
||||
}
|
||||
const url = encodeURI(`${process.env.REACT_APP_CLIENT_BASE_URL}/client#/${section}/custom~yes|${queryStr}`);
|
||||
const { hostname } = new URL(process.env.REACT_APP_CLIENT_BASE_URL);
|
||||
const url = encodeURI(`${hostname}/client#/${section}/custom~yes|${queryStr}`);
|
||||
const urlScheme = `jamkazam://${url}`;
|
||||
return urlScheme;
|
||||
};
|
||||
Loading…
Reference in New Issue