Fix right panel data flow (#7811)

This commit is contained in:
J. Ryan Stinnett 2022-02-16 11:19:28 +00:00 committed by GitHub
parent 78524bddce
commit 0dc1355441
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 254 additions and 74 deletions

View file

@ -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 {