1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-25 17:02:04 +03:00

Add text for room avatar events and skip empty text events

This commit is contained in:
Jaiwanth
2021-06-22 12:50:15 +05:30
parent 12ecaf30df
commit db875508d8
4 changed files with 20 additions and 5 deletions

View File

@ -71,7 +71,8 @@ export default class PlainTextExporter extends Exporter {
let content = "";
for (const event of events) {
if (!haveTileForEvent(event)) continue;
content += `${new Date(event.getTs()).toLocaleString()} - ${this._textForEvent(event)}\n`;
const textForEvent = this._textForEvent(event);
content += textForEvent && `${new Date(event.getTs()).toLocaleString()} - ${textForEvent}\n`;
}
return content;
}