fix ui: fix "open next session" shortcut
This commit is contained in:
parent
415919a8fc
commit
7a95e071b3
1 changed files with 30 additions and 11 deletions
|
|
@ -4,28 +4,45 @@ import cn from 'classnames';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
|
|
||||||
import { PlayerContext } from 'App/components/Session/playerContext';
|
import { PlayerContext } from 'App/components/Session/playerContext';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
import { FullScreenButton, PlayButton, PlayingState } from 'App/player-ui';
|
import { FullScreenButton, PlayButton, PlayingState } from 'App/player-ui';
|
||||||
import { session as sessionRoute, withSiteId } from 'App/routes';
|
import { session as sessionRoute, withSiteId } from 'App/routes';
|
||||||
import useShortcuts from 'Components/Session/Player/ReplayPlayer/useShortcuts';
|
import useShortcuts from 'Components/Session/Player/ReplayPlayer/useShortcuts';
|
||||||
import { LaunchConsoleShortcut, LaunchEventsShortcut, LaunchNetworkShortcut, LaunchPerformanceShortcut, LaunchStateShortcut, LaunchXRaShortcut } from 'Components/Session_/Player/Controls/components/KeyboardHelp';
|
import {
|
||||||
import { CONSOLE, GRAPHQL, INSPECTOR, NETWORK, OVERVIEW, PERFORMANCE, PROFILER, STACKEVENTS, STORAGE, changeSkipInterval, fullscreenOff, fullscreenOn, toggleBottomBlock } from 'Duck/components/player';
|
LaunchConsoleShortcut,
|
||||||
|
LaunchEventsShortcut,
|
||||||
|
LaunchNetworkShortcut,
|
||||||
|
LaunchPerformanceShortcut,
|
||||||
|
LaunchStateShortcut,
|
||||||
|
LaunchXRaShortcut,
|
||||||
|
} from 'Components/Session_/Player/Controls/components/KeyboardHelp';
|
||||||
|
import {
|
||||||
|
CONSOLE,
|
||||||
|
GRAPHQL,
|
||||||
|
INSPECTOR,
|
||||||
|
NETWORK,
|
||||||
|
OVERVIEW,
|
||||||
|
PERFORMANCE,
|
||||||
|
PROFILER,
|
||||||
|
STACKEVENTS,
|
||||||
|
STORAGE,
|
||||||
|
changeSkipInterval,
|
||||||
|
fullscreenOff,
|
||||||
|
fullscreenOn,
|
||||||
|
toggleBottomBlock,
|
||||||
|
} from 'Duck/components/player';
|
||||||
import { fetchSessions } from 'Duck/liveSearch';
|
import { fetchSessions } from 'Duck/liveSearch';
|
||||||
import { Icon } from 'UI';
|
import { Icon } from 'UI';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import DropdownAudioPlayer from '../../../Session/Player/ReplayPlayer/AudioPlayer';
|
import DropdownAudioPlayer from '../../../Session/Player/ReplayPlayer/AudioPlayer';
|
||||||
import ControlButton from './ControlButton';
|
import ControlButton from './ControlButton';
|
||||||
import Timeline from './Timeline';
|
import Timeline from './Timeline';
|
||||||
import PlayerControls from './components/PlayerControls';
|
import PlayerControls from './components/PlayerControls';
|
||||||
import styles from './controls.module.css';
|
import styles from './controls.module.css';
|
||||||
|
|
||||||
|
|
||||||
export const SKIP_INTERVALS = {
|
export const SKIP_INTERVALS = {
|
||||||
2: 2e3,
|
2: 2e3,
|
||||||
5: 5e3,
|
5: 5e3,
|
||||||
|
|
@ -58,7 +75,7 @@ function getStorageName(type: any) {
|
||||||
function Controls(props: any) {
|
function Controls(props: any) {
|
||||||
const { player, store } = React.useContext(PlayerContext);
|
const { player, store } = React.useContext(PlayerContext);
|
||||||
const { uxtestingStore } = useStore();
|
const { uxtestingStore } = useStore();
|
||||||
|
const history = useHistory();
|
||||||
const {
|
const {
|
||||||
playing,
|
playing,
|
||||||
completed,
|
completed,
|
||||||
|
|
@ -89,11 +106,11 @@ function Controls(props: any) {
|
||||||
const sessionTz = session?.timezone;
|
const sessionTz = session?.timezone;
|
||||||
|
|
||||||
const nextHandler = () => {
|
const nextHandler = () => {
|
||||||
props.history.push(withSiteId(sessionRoute(nextSessionId), siteId));
|
history.push(withSiteId(sessionRoute(nextSessionId), siteId));
|
||||||
};
|
};
|
||||||
|
|
||||||
const prevHandler = () => {
|
const prevHandler = () => {
|
||||||
props.history.push(withSiteId(sessionRoute(previousSessionId), siteId));
|
history.push(withSiteId(sessionRoute(previousSessionId), siteId));
|
||||||
};
|
};
|
||||||
|
|
||||||
useShortcuts({
|
useShortcuts({
|
||||||
|
|
@ -337,7 +354,9 @@ const DevtoolsButtons = observer(
|
||||||
label="Profiler"
|
label="Profiler"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{possibleAudio.length ? <DropdownAudioPlayer audioEvents={possibleAudio} /> : null}
|
{possibleAudio.length ? (
|
||||||
|
<DropdownAudioPlayer audioEvents={possibleAudio} />
|
||||||
|
) : null}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue