Parse deeplink uri and update the check
Summary: Parse the deeplink url and update the checks by comparing particular components. Reviewed By: jknoxville Differential Revision: D18093494 fbshipit-source-id: c79c1974a7e50b61724dedd7fd3303093fac944b
This commit is contained in:
committed by
Facebook Github Bot
parent
0077f4c9f2
commit
652ffd43d6
@@ -58,6 +58,7 @@ export default (store: Store, logger: Logger) => {
|
|||||||
ipcRenderer.on(
|
ipcRenderer.on(
|
||||||
'flipper-protocol-handler',
|
'flipper-protocol-handler',
|
||||||
(_event: string, query: string) => {
|
(_event: string, query: string) => {
|
||||||
|
const uri = new URL(query);
|
||||||
if (query.startsWith('flipper://import')) {
|
if (query.startsWith('flipper://import')) {
|
||||||
const {search} = new URL(query);
|
const {search} = new URL(query);
|
||||||
const {url} = qs.parse(search);
|
const {url} = qs.parse(search);
|
||||||
@@ -75,9 +76,17 @@ export default (store: Store, logger: Logger) => {
|
|||||||
store.dispatch(toggleAction('downloadingImportData', false));
|
store.dispatch(toggleAction('downloadingImportData', false));
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else if (query === 'flipper://support-form?form=Litho') {
|
} else if (
|
||||||
logger.track('usage', 'support-form-source', {source: 'deeplink'});
|
uri.protocol === 'flipper:' &&
|
||||||
store.dispatch(setStaticView(SupportRequestFormManager));
|
uri.pathname.includes('support-form')
|
||||||
|
) {
|
||||||
|
const formParam = uri.searchParams.get('form');
|
||||||
|
if (formParam && formParam.toUpperCase() === 'litho'.toUpperCase()) {
|
||||||
|
// Right now we just support Litho
|
||||||
|
logger.track('usage', 'support-form-source', {source: 'deeplink'});
|
||||||
|
store.dispatch(setStaticView(SupportRequestFormManager));
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
const match = uriComponents(query);
|
const match = uriComponents(query);
|
||||||
if (match.length > 1) {
|
if (match.length > 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user