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
This commit is contained in:
Pascal Hartig
2021-09-08 08:43:18 -07:00
committed by Facebook GitHub Bot
parent c2aa8bcb59
commit 262cd6105b
3 changed files with 26 additions and 20 deletions

View File

@@ -103,25 +103,27 @@ export function SandyApp() {
useEffect(() => { useEffect(() => {
if (fbConfig.warnFBEmployees && isProduction()) { if (fbConfig.warnFBEmployees && isProduction()) {
isFBEmployee().then((isEmployee) => { isFBEmployee()
if (isEmployee) { .then((isEmployee) => {
notification.warning({ if (isEmployee) {
placement: 'bottomLeft', notification.warning({
message: 'Please use Flipper@FB', placement: 'bottomLeft',
description: ( message: 'Please use Flipper@FB',
<> description: (
You are using the open-source version of Flipper. Install the <>
internal build from{' '} You are using the open-source version of Flipper. Install the
<Link href="munki://detail-Flipper"> internal build from{' '}
Managed Software Center <Link href="munki://detail-Flipper">
</Link>{' '} Managed Software Center
to get access to more plugins. </Link>{' '}
</> to get access to more plugins.
), </>
duration: null, ),
}); duration: null,
} });
}); }
})
.catch((e) => console.error('isEmployee check failed:', e));
} }
}, []); }, []);

View File

@@ -186,6 +186,8 @@ function computeEntries(
// hide non default devices, unless they have a connected client or plugins // hide non default devices, unless they have a connected client or plugins
canBeDefaultDevice(device) || canBeDefaultDevice(device) ||
device.hasDevicePlugins || device.hasDevicePlugins ||
// Deliberate use of Sync.
// eslint-disable-next-line node/no-sync
clients.some((c) => c.deviceSync === device), clients.some((c) => c.deviceSync === device),
) )
.map((device) => { .map((device) => {

View File

@@ -217,7 +217,8 @@ export function Notification() {
activeNotifications.map((noti) => { activeNotifications.map((noti) => {
const client = getClientById(store, noti.client); const client = getClientById(store, noti.client);
const device = client const device = client
? client.deviceSync ? // eslint-disable-next-line node/no-sync
client.deviceSync
: getDeviceById(store, noti.client); : getDeviceById(store, noti.client);
const plugin = getPlugin(noti.pluginId); const plugin = getPlugin(noti.pluginId);
return { return {
@@ -311,6 +312,7 @@ export function openNotification(store: Store, noti: PluginNotificationOrig) {
selectPlugin({ selectPlugin({
selectedPlugin: noti.pluginId, selectedPlugin: noti.pluginId,
selectedApp: noti.client, selectedApp: noti.client,
// eslint-disable-next-line node/no-sync
selectedDevice: client.deviceSync, selectedDevice: client.deviceSync,
deepLinkPayload: noti.notification.action, deepLinkPayload: noti.notification.action,
}), }),