Skip to content

Commit

Permalink
app: Show waiting for device list when devices are off but connected
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Jan 9, 2021
1 parent 903f18a commit 2e24ab2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/renderer/views/devices/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@ import store, {DeviceStore} from 'src/shared/store';
const sortById = (a: DeviceStore, b: DeviceStore) => a.device.id - b.device.id;

const Devices = observer(() => {
const deviceMap = groupBy([...store.devices.values()], d => d.device.type);
const deviceList = [...store.devices.values()];
const deviceMap = groupBy(deviceList, d => d.device.type);
const otherDevices = [
...(deviceMap[DeviceType.Mixer] ?? []),
...(deviceMap[DeviceType.Rekordbox] ?? []),
];

return (
<AnimatePresence initial={false}>
{store.networkState === NetworkState.Online && <ConnectingSplash key="splash" />}
{(store.networkState === NetworkState.Online ||
(store.networkState === NetworkState.Connected && deviceList.length === 0)) && (
<ConnectingSplash key="splash" />
)}
{store.networkState === NetworkState.Failed && <ConnectionError key="error" />}
{deviceMap[DeviceType.CDJ]?.sort(sortById).map(deviceStore => {
const {device, state} = deviceStore;
Expand Down

1 comment on commit 2e24ab2

@vercel
Copy link

@vercel vercel bot commented on 2e24ab2 Jan 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.