Fix right panel data flow (#7811)
This commit is contained in:
parent
78524bddce
commit
0dc1355441
14 changed files with 254 additions and 74 deletions
|
@ -72,16 +72,16 @@ export default abstract class HeaderButtons<P = {}> extends React.Component<IPro
|
|||
|
||||
public setPhase(phase: RightPanelPhases, cardState?: Partial<IRightPanelCardState>) {
|
||||
const rps = RightPanelStore.instance;
|
||||
if (rps.currentCard.phase == phase && !cardState && rps.isOpenForRoom) {
|
||||
if (rps.currentCard.phase == phase && !cardState && rps.isOpen) {
|
||||
rps.togglePanel();
|
||||
} else {
|
||||
RightPanelStore.instance.setCard({ phase, state: cardState });
|
||||
if (!rps.isOpenForRoom) rps.togglePanel();
|
||||
if (!rps.isOpen) rps.togglePanel();
|
||||
}
|
||||
}
|
||||
|
||||
public isPhase(phases: string | string[]): boolean {
|
||||
if (!RightPanelStore.instance.isOpenForRoom) return false;
|
||||
if (!RightPanelStore.instance.isOpen) return false;
|
||||
if (Array.isArray(phases)) {
|
||||
return phases.includes(this.state.phase);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue