mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2026-05-24 16:00:16 -04:00
10 lines
514 B
JavaScript
10 lines
514 B
JavaScript
export const getAppLink = ({ navigate, location, targetApp, info }) => {
|
|
const { search } = location;
|
|
const protocol = info.enigma.secure ? 'wss' : 'ws';
|
|
const host = info.enigma.host === 'localhost' ? `${info.enigma.host}:${info.enigma.port}` : info.enigma.host;
|
|
const newEngineUrl = `${protocol}://${host}/app/${encodeURIComponent(targetApp)}`;
|
|
const modifiedEngineUrl = search.replace(info.engineUrl, newEngineUrl);
|
|
|
|
navigate(`/dev/${modifiedEngineUrl}`.replace('&shouldFetchAppList=true', ''));
|
|
};
|