Media Viewer: Patch playbackRate exception
This commit is contained in:
parent
fe0aa60bf9
commit
b6b2ed0379
@ -3,6 +3,7 @@ import type { ActionReturnType } from '../../types';
|
||||
import { updateTabState } from '../../reducers/tabs';
|
||||
import { selectTabState } from '../../selectors';
|
||||
import { getCurrentTabId } from '../../../util/establishMultitabRole';
|
||||
import { DEFAULT_PLAYBACK_RATE } from '../../../config';
|
||||
|
||||
addActionHandler('openMediaViewer', (global, actions, payload): ActionReturnType => {
|
||||
const {
|
||||
@ -11,6 +12,7 @@ addActionHandler('openMediaViewer', (global, actions, payload): ActionReturnType
|
||||
} = payload;
|
||||
|
||||
const tabState = selectTabState(global, tabId);
|
||||
|
||||
return updateTabState(global, {
|
||||
mediaViewer: {
|
||||
...tabState.mediaViewer,
|
||||
@ -22,7 +24,12 @@ addActionHandler('openMediaViewer', (global, actions, payload): ActionReturnType
|
||||
origin,
|
||||
isHidden: false,
|
||||
volume: volume ?? tabState.mediaViewer.volume,
|
||||
playbackRate: playbackRate || tabState.mediaViewer.playbackRate || global.mediaViewer.lastPlaybackRate,
|
||||
playbackRate: (
|
||||
playbackRate
|
||||
|| tabState.mediaViewer.playbackRate
|
||||
|| global.mediaViewer.lastPlaybackRate
|
||||
|| DEFAULT_PLAYBACK_RATE
|
||||
),
|
||||
isMuted: isMuted || tabState.mediaViewer.isMuted,
|
||||
},
|
||||
forwardMessages: {},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user