mirror of
https://github.com/vector-im/element-web.git
synced 2025-09-02 12:21:11 +02:00
basic error handling for malformed quotes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
3b1d69edbb
commit
a6cefb83f8
@ -53,8 +53,8 @@ export default class Quote extends React.Component {
|
|||||||
events: [],
|
events: [],
|
||||||
// Whether the top (oldest) event should be shown or spoilered
|
// Whether the top (oldest) event should be shown or spoilered
|
||||||
show: true,
|
show: true,
|
||||||
// Whether an error was encountered fetching another older event, show if it does
|
// Whether an error was encountered fetching nested older event, show node if it does
|
||||||
err: null,
|
err: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onQuoteClick = this.onQuoteClick.bind(this);
|
this.onQuoteClick = this.onQuoteClick.bind(this);
|
||||||
@ -124,10 +124,16 @@ export default class Quote extends React.Component {
|
|||||||
// addRichQuote(roomId, eventId) {
|
// addRichQuote(roomId, eventId) {
|
||||||
addRichQuote(href) {
|
addRichQuote(href) {
|
||||||
const {roomIdentifier, eventId} = this.parseUrl(href);
|
const {roomIdentifier, eventId} = this.parseUrl(href);
|
||||||
if (!roomIdentifier || !eventId) return;
|
if (!roomIdentifier || !eventId) {
|
||||||
|
this.setState({ err: true });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const room = this.getRoom(roomIdentifier);
|
const room = this.getRoom(roomIdentifier);
|
||||||
if (!room) return;
|
if (!room) {
|
||||||
|
this.setState({ err: true });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.getEvent(room, eventId, false);
|
this.getEvent(room, eventId, false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user