diff --git a/desktop/plugins/navigation/util/appMatchPatterns.tsx b/desktop/plugins/navigation/util/appMatchPatterns.tsx index 4c57e567e..16fa1b1e0 100644 --- a/desktop/plugins/navigation/util/appMatchPatterns.tsx +++ b/desktop/plugins/navigation/util/appMatchPatterns.tsx @@ -11,6 +11,14 @@ import fs from 'fs'; import path from 'path'; import {BaseDevice, AndroidDevice, IOSDevice} from 'flipper'; import {AppMatchPattern} from '../types'; +import {remote} from 'electron'; + +let patternsPath: string | undefined; + +function getPatternsBasePath() { + return (patternsPath = + patternsPath ?? path.join(remote.app.getAppPath(), 'facebook')); +} const extractAppNameFromSelectedApp = (selectedApp: string | null) => { if (selectedApp == null) { @@ -35,7 +43,7 @@ export const getAppMatchPatterns = ( } else { return; } - const patternsPath = path.join('facebook', filename); + patternsPath = path.join(getPatternsBasePath(), filename); fs.readFile(patternsPath, (err, data) => { if (err) { reject(err);