Fix the ugly solution
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
d7811d9db7
commit
b79f2d0699
1 changed files with 2 additions and 6 deletions
|
@ -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),
|
||||||
|
|
Loading…
Reference in a new issue