Fix deeplink parsing issue and device plugin highlighting

Summary:
This diff fixes an issue where the selected device was not correctly updated when selecting a device plugin, causing the wrong plugin, or none at all, to be highlighted.

This diff fixes an issue where deeplinks were not correctly parsed if formatted as shown in the test plan of D20920587 (it was a different format in the recording, but after looking into it, using `plugin?params` instead of `plugin/?params` is the natural thing to do, so we now support both)

Reviewed By: jknoxville

Differential Revision: D21154190

fbshipit-source-id: c31132aaf7213ee1c3c188a6a1cf2b6bcc7b5b00
This commit is contained in:
Michel Weststrate
2020-04-21 06:31:52 -07:00
committed by Facebook GitHub Bot
parent c0a9150dd8
commit 60ddad7e08
3 changed files with 16 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ export const uriComponents = (url: string): Array<string> => {
return [];
}
const match: Array<string> | undefined | null = url.match(
/^flipper:\/\/([^\/]*)\/([^\/]*)\/?(.*)$/,
/^flipper:\/\/([^\/]*)\/([^\/\?]*)\/?(.*)$/,
);
if (match) {
return match.map(decodeURIComponent).slice(1).filter(Boolean);