Fix saving room pill part to history

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-05-01 10:59:28 +02:00
parent d203e8f129
commit ee8d688de1
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -287,6 +287,14 @@ abstract class PillPart extends BasePart implements IPillPart {
} }
} }
serialize(): ISerializedPillPart {
return {
type: this.type,
text: this.text,
resourceId: this.resourceId,
};
}
get canEdit() { get canEdit() {
return false; return false;
} }
@ -394,14 +402,6 @@ class UserPillPart extends PillPart {
get className() { get className() {
return "mx_UserPill mx_Pill"; return "mx_UserPill mx_Pill";
} }
serialize(): ISerializedPillPart {
return {
type: this.type,
text: this.text,
resourceId: this.resourceId,
};
}
} }
class PillCandidatePart extends PlainBasePart implements IPillCandidatePart { class PillCandidatePart extends PlainBasePart implements IPillCandidatePart {
@ -495,7 +495,7 @@ export class PartCreator {
case Type.PillCandidate: case Type.PillCandidate:
return this.pillCandidate(part.text); return this.pillCandidate(part.text);
case Type.RoomPill: case Type.RoomPill:
return this.roomPill(part.text); return this.roomPill(part.resourceId);
case Type.UserPill: case Type.UserPill:
return this.userPill(part.text, part.resourceId); return this.userPill(part.text, part.resourceId);
} }