Skip to content

Commit

Permalink
Fix rerolling
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed Mar 23, 2020
1 parent d6902af commit 9f557aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 4 additions & 0 deletions packages/app/app/components/HelpModal/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

$icon_color: rgba($white, 0.75) !important;

.ui.page.modals.dimmer {
background: rgba($background, 0.85);
}

.help_modal {
top: 25% !important;
color: $icon_color;
Expand Down
18 changes: 8 additions & 10 deletions packages/app/app/components/PlayQueue/QueuePopup/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useRef, useCallback } from 'react';
import PropTypes from 'prop-types';
import cs from 'classnames';
import { withState, withHandlers, compose } from 'recompose';
import { withState, withHandlers, withProps, compose } from 'recompose';
import { Popup } from 'semantic-ui-react';
import { StreamInfo } from '@nuclear/ui';

Expand All @@ -21,16 +21,11 @@ export const QueuePopup = ({
track,
index,
actions,
plugins
plugins,
selectedStream
}) => {
const triggerElement = useRef(null);

const getSelectedStreamForQueueItem = track => {
_.find(track.streams, { source: plugins.selected.streamProviders });
};

const selectedStream = getSelectedStreamForQueueItem(track);

const handleOpen = useCallback(
event => {
event.preventDefault();
Expand All @@ -46,7 +41,7 @@ export const QueuePopup = ({
const handleImageLoaded = useCallback(() => setImageReady(true), [setImageReady]);

const handleRerollTrack = track => {
const selectedStreamProvider = _.find(plugins.streamProviders, { source: plugins.selected.streamProviders });
const selectedStreamProvider = _.find(plugins.plugins.streamProviders, { sourceName: plugins.selected.streamProviders });
actions.rerollTrack(selectedStreamProvider, selectedStream, track);
};

Expand Down Expand Up @@ -112,5 +107,8 @@ export default compose(
withState('imageReady', 'setImageReady', false),
withHandlers({
handleClose: ({ setOpen }) => () => setOpen(false)
})
}),
withProps(({ track, plugins }) => ({
selectedStream: _.find(track.streams, { source: plugins.selected.streamProviders })
}))
)(QueuePopup);
2 changes: 1 addition & 1 deletion packages/ui/lib/components/StreamInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const StreamInfo = ({
<div className={styles.stream_thumbnail}>
<Img
alt=''
src={selectedStream.thumbnail || track.thumbnail}
src={_.get(selectedStream, 'thumbnail') || _.get(track, 'thumbnail')}
unloader={<img src={artPlaceholder} />}
onLoad={handleImageLoaded}
/>
Expand Down

0 comments on commit 9f557aa

Please sign in to comment.