fix(player): fix some livepl components for multi tab states

This commit is contained in:
nick-delirium 2023-05-24 17:48:06 +02:00
parent 61f212b5f1
commit e161e4f550
5 changed files with 10 additions and 6 deletions

View file

@ -25,13 +25,15 @@ function Overlay({
const {
messagesLoading,
cssLoading,
peerConnectionStatus,
livePlay,
calling,
remoteControl,
recordingState,
tabStates,
currentTab
} = store.get()
const cssLoading = tabStates[currentTab].cssLoading || false
const loading = messagesLoading || cssLoading
const liveStatusText = getStatusText(peerConnectionStatus)
const connectionStatus = peerConnectionStatus

View file

@ -25,7 +25,8 @@ interface IProps {
function Exceptions({ errorStack, sourcemapUploaded, loading }: IProps) {
const { player, store } = React.useContext(PlayerContext);
const { logListNow: logs, exceptionsList: exceptions } = store.get();
const { tabStates, currentTab } = store.get();
const { logListNow: logs = [], exceptionsList: exceptions = [] } = tabStates[currentTab]
const [filter, setFilter] = React.useState('');
const [currentError, setCurrentErrorVal] = React.useState(null);

View file

@ -14,7 +14,8 @@ function renderDefaultStatus() {
function GraphQL() {
const { player, store } = React.useContext(PlayerContext);
const { graphqlList: list, graphqlListNow: listNow, time, livePlay } = store.get();
const { time, livePlay, tabStates, currentTab } = store.get();
const { graphqlList: list = [], graphqlListNow: listNow = [] } = tabStates[currentTab]
const defaultState = {
filter: '',

View file

@ -15,8 +15,8 @@ const renderName = (p: any) => <TextEllipsis text={p.name} />;
function ProfilerPanel() {
const { store } = React.useContext(PlayerContext)
const profiles = store.get().profilesList as any[] // TODO lest internal types
const { tabStates, currentTab } = store.get()
const profiles = tabStates[currentTab].profilesList || [] as any[] // TODO lest internal types
const { showModal } = useModal();
const [ filter, onFilterChange ] = useInputState()

View file

@ -134,7 +134,7 @@ export default class RemoteControl {
toggleAnnotation(enable?: boolean) {
if (typeof enable !== "boolean") {
enable = !!this.store.get().annotating
enable = this.store.get().annotating
}
if (enable && !this.annot) {
const annot = this.annot = new AnnotationCanvas()