Merge branch 'develop' into germain-gg/notifications-labs

This commit is contained in:
RMidhunSuresh 2023-09-15 16:28:59 +05:30
commit 2f69013f6d
No known key found for this signature in database
73 changed files with 3445 additions and 3395 deletions

View file

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