Recommended changes #7089

Merged
saltrafael merged 2 commits from recommended-changes into master 2021-09-16 22:00:44 +02:00
Showing only changes of commit 0874b7b9b6 - Show all commits

View file

@ -35,13 +35,14 @@ export const makeSelectIsPlaying = (uri: string) =>
export const makeSelectIsPlayerFloating = (location: UrlLocation) => export const makeSelectIsPlayerFloating = (location: UrlLocation) =>
createSelector(selectPrimaryUri, selectPlayingUri, (primaryUri, playingUri) => { createSelector(selectPrimaryUri, selectPlayingUri, (primaryUri, playingUri) => {
const hasSecondarySource = playingUri && (playingUri.source === 'comment' || playingUri.source === 'markdown');
const isInlineSecondaryPlayer = const isInlineSecondaryPlayer =
playingUri && playingUri && playingUri.uri !== primaryUri && location.pathname === playingUri.pathname && hasSecondarySource;
playingUri.uri !== primaryUri &&
location.pathname === playingUri.pathname &&
(playingUri.source === 'comment' || playingUri.source === 'markdown');
if ((playingUri && playingUri.primaryUri === primaryUri) || isInlineSecondaryPlayer) { if (
(playingUri && (hasSecondarySource ? playingUri.primaryUri === primaryUri : playingUri.uri === primaryUri)) ||
isInlineSecondaryPlayer
) {
return false; return false;
} }