Fix the ugly solution

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-07-12 12:21:59 +02:00
parent d7811d9db7
commit b79f2d0699
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -78,7 +78,6 @@ interface IPillCandidatePart extends Omit<IBasePart, "type" | "createAutoComplet
interface IPillPart extends Omit<IBasePart, "type" | "resourceId"> { interface IPillPart extends Omit<IBasePart, "type" | "resourceId"> {
type: Type.AtRoomPill | Type.RoomPill | Type.UserPill; type: Type.AtRoomPill | Type.RoomPill | Type.UserPill;
resourceId: string; resourceId: string;
onClick?(): void;
} }
export type Part = IBasePart | IPillCandidatePart | IPillPart; export type Part = IBasePart | IPillCandidatePart | IPillPart;
@ -310,7 +309,7 @@ abstract class PillPart extends BasePart implements IPillPart {
abstract get className(): string; abstract get className(): string;
abstract onClick?(): void; protected onClick?: () => void;
abstract setAvatar(node: HTMLElement): void; abstract setAvatar(node: HTMLElement): void;
} }
@ -373,9 +372,6 @@ class RoomPillPart extends PillPart {
get className() { get className() {
return "mx_RoomPill mx_Pill"; return "mx_RoomPill mx_Pill";
} }
// FIXME: We do this to shut up the linter, is there a way to do this properly
onClick = undefined;
} }
class AtRoomPillPart extends RoomPillPart { class AtRoomPillPart extends RoomPillPart {
@ -414,7 +410,7 @@ class UserPillPart extends PillPart {
this._setAvatarVars(node, avatarUrl, initialLetter); this._setAvatarVars(node, avatarUrl, initialLetter);
} }
onClick = () => { protected onClick = () => {
defaultDispatcher.dispatch({ defaultDispatcher.dispatch({
action: Action.ViewUser, action: Action.ViewUser,
member: MatrixClientPeg.get().getRoom(RoomViewStore.getRoomId()).getMember(this.resourceId), member: MatrixClientPeg.get().getRoom(RoomViewStore.getRoomId()).getMember(this.resourceId),