From 262cd6105bbe4bead7731d2bd8d7d4ad0b096124 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 8 Sep 2021 08:43:18 -0700 Subject: [PATCH] Fix Flipper lints #5 Summary: A few more lints. Some already got fixed since the task was created. Reviewed By: timur-valiev Differential Revision: D30782192 fbshipit-source-id: 2d03d24034173d632280035e6ba68f485fbe62f3 --- desktop/app/src/sandy-chrome/SandyApp.tsx | 40 ++++++++++--------- .../sandy-chrome/appinspect/AppSelector.tsx | 2 + .../notification/Notification.tsx | 4 +- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/desktop/app/src/sandy-chrome/SandyApp.tsx b/desktop/app/src/sandy-chrome/SandyApp.tsx index a9d2a4574..340723847 100644 --- a/desktop/app/src/sandy-chrome/SandyApp.tsx +++ b/desktop/app/src/sandy-chrome/SandyApp.tsx @@ -103,25 +103,27 @@ export function SandyApp() { useEffect(() => { if (fbConfig.warnFBEmployees && isProduction()) { - isFBEmployee().then((isEmployee) => { - if (isEmployee) { - notification.warning({ - placement: 'bottomLeft', - message: 'Please use Flipper@FB', - description: ( - <> - You are using the open-source version of Flipper. Install the - internal build from{' '} - - Managed Software Center - {' '} - to get access to more plugins. - - ), - duration: null, - }); - } - }); + isFBEmployee() + .then((isEmployee) => { + if (isEmployee) { + notification.warning({ + placement: 'bottomLeft', + message: 'Please use Flipper@FB', + description: ( + <> + You are using the open-source version of Flipper. Install the + internal build from{' '} + + Managed Software Center + {' '} + to get access to more plugins. + + ), + duration: null, + }); + } + }) + .catch((e) => console.error('isEmployee check failed:', e)); } }, []); diff --git a/desktop/app/src/sandy-chrome/appinspect/AppSelector.tsx b/desktop/app/src/sandy-chrome/appinspect/AppSelector.tsx index f6dcea450..a8a4fd481 100644 --- a/desktop/app/src/sandy-chrome/appinspect/AppSelector.tsx +++ b/desktop/app/src/sandy-chrome/appinspect/AppSelector.tsx @@ -186,6 +186,8 @@ function computeEntries( // hide non default devices, unless they have a connected client or plugins canBeDefaultDevice(device) || device.hasDevicePlugins || + // Deliberate use of Sync. + // eslint-disable-next-line node/no-sync clients.some((c) => c.deviceSync === device), ) .map((device) => { diff --git a/desktop/app/src/sandy-chrome/notification/Notification.tsx b/desktop/app/src/sandy-chrome/notification/Notification.tsx index 093eda4ab..e1976b169 100644 --- a/desktop/app/src/sandy-chrome/notification/Notification.tsx +++ b/desktop/app/src/sandy-chrome/notification/Notification.tsx @@ -217,7 +217,8 @@ export function Notification() { activeNotifications.map((noti) => { const client = getClientById(store, noti.client); const device = client - ? client.deviceSync + ? // eslint-disable-next-line node/no-sync + client.deviceSync : getDeviceById(store, noti.client); const plugin = getPlugin(noti.pluginId); return { @@ -311,6 +312,7 @@ export function openNotification(store: Store, noti: PluginNotificationOrig) { selectPlugin({ selectedPlugin: noti.pluginId, selectedApp: noti.client, + // eslint-disable-next-line node/no-sync selectedDevice: client.deviceSync, deepLinkPayload: noti.notification.action, }),