Update Right Panel phase recall behaviour
This commit is contained in:
parent
2527344294
commit
8f94a42daf
2 changed files with 11 additions and 5 deletions
|
@ -33,6 +33,8 @@ interface RightPanelStoreState {
|
|||
lastRoomPhase: RightPanelPhases;
|
||||
lastGroupPhase: RightPanelPhases;
|
||||
|
||||
previousPhase?: RightPanelPhases;
|
||||
|
||||
// Extra information about the last phase
|
||||
lastRoomPhaseParams: {[key: string]: any};
|
||||
}
|
||||
|
@ -89,6 +91,10 @@ export default class RightPanelStore extends Store<ActionPayload> {
|
|||
return this.state.lastGroupPhase;
|
||||
}
|
||||
|
||||
get previousPhase(): RightPanelPhases | null {
|
||||
return RIGHT_PANEL_PHASES_NO_ARGS.includes(this.state.previousPhase) ? this.state.previousPhase : null;
|
||||
}
|
||||
|
||||
get visibleRoomPanelPhase(): RightPanelPhases {
|
||||
return this.isOpenForRoom ? this.roomPanelPhase : null;
|
||||
}
|
||||
|
@ -176,23 +182,27 @@ export default class RightPanelStore extends Store<ActionPayload> {
|
|||
if (targetPhase === this.state.lastGroupPhase) {
|
||||
this.setState({
|
||||
showGroupPanel: !this.state.showGroupPanel,
|
||||
previousPhase: null,
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
lastGroupPhase: targetPhase,
|
||||
showGroupPanel: true,
|
||||
previousPhase: this.state.lastGroupPhase,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (targetPhase === this.state.lastRoomPhase && !refireParams) {
|
||||
this.setState({
|
||||
showRoomPanel: !this.state.showRoomPanel,
|
||||
previousPhase: null,
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
lastRoomPhase: targetPhase,
|
||||
showRoomPanel: true,
|
||||
lastRoomPhaseParams: refireParams || {},
|
||||
previousPhase: this.state.lastRoomPhase,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue