Skip to content

Commit

Permalink
website: Use real PlayedTrack for demo data
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Jan 13, 2021
1 parent b9c83a8 commit 77c15f4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/website/demo/helpers.tsx
@@ -1,7 +1,7 @@
import {cloneDeep, random} from 'lodash';
import {CDJStatus, MediaSlot, TrackType} from 'prolink-connect/lib/types';

import {AppStore} from 'src/shared/store';
import {AppStore, PlayedTrack} from 'src/shared/store';
import {makeRandomTrack} from 'src/utils/randomMetadata';

export async function loadTrack(
Expand Down Expand Up @@ -86,10 +86,8 @@ export function markAsPlaying(store: AppStore, deviceId: number) {
const s = store.devices.get(deviceId)!;

// Deep clone since we cannot observe two of the same object in our store
store.mixstatus.trackHistory.push({
track: cloneDeep(s.track!),
artwork: s.artwork,
playedAt: new Date(),
isId: false,
});
const played = new PlayedTrack(new Date(), cloneDeep(s.track!));
played.artwork = s.artwork;

store.mixstatus.trackHistory.push(played);
}

0 comments on commit 77c15f4

Please sign in to comment.