start handling MESSAGE_STATUS_FAILED
This commit is contained in:
+14
-7
@@ -3619,19 +3619,26 @@ class ChatMessage extends React.Component {
|
||||
/* Received/read indicator */
|
||||
class ReceivedMarker extends React.PureComponent {
|
||||
render() {
|
||||
var timestamp = (this.props.received <= Tinode.MESSAGE_STATUS_SENDING) ?
|
||||
"sending ..." :
|
||||
shortDateFormat(this.props.timestamp);
|
||||
let timestamp;
|
||||
if (this.props.received <= Tinode.MESSAGE_STATUS_SENDING) {
|
||||
timestamp = "sending ...";
|
||||
} else if (this.props.received == Tinode.MESSAGE_STATUS_FAILED) {
|
||||
timestamp = "failed";
|
||||
} else {
|
||||
timestamp = shortDateFormat(this.props.timestamp);
|
||||
}
|
||||
|
||||
var marker = null;
|
||||
let marker = null;
|
||||
if (this.props.received <= Tinode.MESSAGE_STATUS_SENDING) {
|
||||
marker = (<i className="material-icons small">access_time</i>); // watch face
|
||||
} else if (this.props.received == Tinode.MESSAGE_STATUS_FAILED) {
|
||||
marker = (<i className="material-icons small red">error_outline</i>); // icon (!)
|
||||
} else if (this.props.received == Tinode.MESSAGE_STATUS_SENT) {
|
||||
marker = (<i className="material-icons small">done</i>); // checkmark
|
||||
} else if (this.props.received == Tinode.MESSAGE_STATUS_RECEIVED) {
|
||||
marker = (<i className="material-icons small">done_all</i>); // double checkmark
|
||||
} else if (this.props.received == Tinode.MESSAGE_STATUS_READ) {
|
||||
marker = (<i className="material-icons small blue">done_all</i>); // open eye
|
||||
marker = (<i className="material-icons small blue">done_all</i>); // blue double checkmark
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -4004,7 +4011,7 @@ class MessagesView extends React.Component {
|
||||
newState.scrollPosition = 0;
|
||||
}
|
||||
|
||||
// Aknowledge all messages, including own messges.
|
||||
// Aknowledge all messages, including own messages.
|
||||
let status = topic.msgStatus(msg);
|
||||
if (status >= Tinode.MESSAGE_STATUS_SENT) {
|
||||
this.props.readTimerHandler(() => {
|
||||
@@ -4979,7 +4986,7 @@ class TinodeWeb extends React.Component {
|
||||
// Sending "received" notifications
|
||||
tnData(data) {
|
||||
let topic = this.tinode.getTopic(data.topic);
|
||||
if (topic.msgStatus(data) > Tinode.MESSAGE_STATUS_SENDING) {
|
||||
if (topic.msgStatus(data) >= Tinode.MESSAGE_STATUS_SENT) {
|
||||
clearTimeout(this.receivedTimer);
|
||||
this.receivedTimer = setTimeout(() => {
|
||||
this.receivedTimer = undefined;
|
||||
|
||||
Reference in New Issue
Block a user