Merge branch 'develop' into germain-gg/notifications-labs
This commit is contained in:
commit
2f69013f6d
73 changed files with 3445 additions and 3395 deletions
|
@ -23,7 +23,6 @@ import React from "react";
|
|||
import dis from "../../../dispatcher/dispatcher";
|
||||
import RightPanelStore from "../../../stores/right-panel/RightPanelStore";
|
||||
import { RightPanelPhases } from "../../../stores/right-panel/RightPanelStorePhases";
|
||||
import { IRightPanelCardState } from "../../../stores/right-panel/RightPanelStoreIPanelState";
|
||||
import { UPDATE_EVENT } from "../../../stores/AsyncStore";
|
||||
import { NotificationColor } from "../../../stores/notifications/NotificationColor";
|
||||
import { ActionPayload } from "../../../dispatcher/payloads";
|
||||
|
@ -66,7 +65,6 @@ export default abstract class HeaderButtons<P = {}> extends React.Component<IPro
|
|||
|
||||
public componentDidMount(): void {
|
||||
RightPanelStore.instance.on(UPDATE_EVENT, this.onRightPanelStoreUpdate);
|
||||
this.dispatcherRef = dis.register(this.onAction.bind(this)); // used by subclasses
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
|
@ -76,18 +74,6 @@ export default abstract class HeaderButtons<P = {}> extends React.Component<IPro
|
|||
if (this.watcherRef) SettingsStore.unwatchSetting(this.watcherRef);
|
||||
}
|
||||
|
||||
protected abstract onAction(payload: ActionPayload): void;
|
||||
|
||||
public setPhase(phase: RightPanelPhases, cardState?: Partial<IRightPanelCardState>): void {
|
||||
const rps = RightPanelStore.instance;
|
||||
if (rps.currentCard.phase == phase && !cardState && rps.isOpen) {
|
||||
rps.togglePanel(null);
|
||||
} else {
|
||||
RightPanelStore.instance.setCard({ phase, state: cardState });
|
||||
if (!rps.isOpen) rps.togglePanel(null);
|
||||
}
|
||||
}
|
||||
|
||||
public isPhase(phases: string | string[]): boolean {
|
||||
if (!RightPanelStore.instance.isOpen) return false;
|
||||
if (Array.isArray(phases)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue