Fix Messenger not showing up in Sandy
Summary: Metro and Mac device were always hidden in Sandy, but they should only be hidden if they don't have underlying Clients. Fixes https://fb.workplace.com/groups/748354712423318/permalink/775342569724532/ Reviewed By: nikoant Differential Revision: D25369492 fbshipit-source-id: fdc25c3646d8339ae029425b4c45d8631bbee762
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fa00575dec
commit
244b6dc1be
@@ -172,29 +172,38 @@ function computeEntries(
|
|||||||
onSelectDevice: (device: BaseDevice) => void,
|
onSelectDevice: (device: BaseDevice) => void,
|
||||||
onSelectApp: (device: BaseDevice, client: Client) => void,
|
onSelectApp: (device: BaseDevice, client: Client) => void,
|
||||||
) {
|
) {
|
||||||
const entries = devices.filter(canBeDefaultDevice).map((device) => {
|
const entries = devices
|
||||||
const deviceEntry = (
|
.filter(
|
||||||
<Menu.Item
|
(device) =>
|
||||||
icon={getOsIcon(device.os)}
|
// hide non default devices, unless they have a connected client
|
||||||
key={device.serial}
|
canBeDefaultDevice(device) ||
|
||||||
style={{fontWeight: 'bold'}}
|
clients.some((c) => c.deviceSync === device),
|
||||||
onClick={() => {
|
)
|
||||||
onSelectDevice(device);
|
.map((device) => {
|
||||||
}}>
|
const deviceEntry = (
|
||||||
{device.displayTitle()}
|
<Menu.Item
|
||||||
</Menu.Item>
|
icon={getOsIcon(device.os)}
|
||||||
);
|
key={device.serial}
|
||||||
const clientEntries = getAvailableClients(device, clients).map((client) => (
|
style={{fontWeight: 'bold'}}
|
||||||
<Menu.Item
|
onClick={() => {
|
||||||
key={client.id}
|
onSelectDevice(device);
|
||||||
onClick={() => {
|
}}>
|
||||||
onSelectApp(device, client);
|
{device.displayTitle()}
|
||||||
}}>
|
</Menu.Item>
|
||||||
<Radio value={client.id}>{client.query.app}</Radio>
|
);
|
||||||
</Menu.Item>
|
const clientEntries = getAvailableClients(device, clients).map(
|
||||||
));
|
(client) => (
|
||||||
return [deviceEntry, ...clientEntries];
|
<Menu.Item
|
||||||
});
|
key={client.id}
|
||||||
|
onClick={() => {
|
||||||
|
onSelectApp(device, client);
|
||||||
|
}}>
|
||||||
|
<Radio value={client.id}>{client.query.app}</Radio>
|
||||||
|
</Menu.Item>
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return [deviceEntry, ...clientEntries];
|
||||||
|
});
|
||||||
if (uninitializedClients.length) {
|
if (uninitializedClients.length) {
|
||||||
entries.push([
|
entries.push([
|
||||||
<Menu.Item key="connecting" style={{fontWeight: 'bold'}}>
|
<Menu.Item key="connecting" style={{fontWeight: 'bold'}}>
|
||||||
|
|||||||
Reference in New Issue
Block a user