everything seems to work now
This commit is contained in:
@@ -205,8 +205,9 @@ export function previewFormatter(style, data, values, key) {
|
||||
// Ignore JSON attachments: they are form response payloads.
|
||||
return null;
|
||||
}
|
||||
// Clear inband data.
|
||||
data.val = null;
|
||||
// Clear payload.
|
||||
delete data.val;
|
||||
delete data.ref;
|
||||
}
|
||||
el = React.Fragment;
|
||||
values = [<i key="ex" className="material-icons">attachment</i>, this.formatMessage(messages.drafty_attachment)];
|
||||
@@ -260,11 +261,12 @@ export function quoteFormatter(style, data, values, key) {
|
||||
// Ignore JSON attachments: they are form response payloads.
|
||||
return null;
|
||||
}
|
||||
// Clear inband data.
|
||||
data.val = null;
|
||||
fname = data.name;
|
||||
// Clear payload.
|
||||
delete data.val;
|
||||
delete data.ref;
|
||||
}
|
||||
if (!fname)
|
||||
if (!fname) {
|
||||
fname = this.formatMessage(messages.drafty_attachment);
|
||||
}
|
||||
el = React.Fragment;
|
||||
|
||||
@@ -379,7 +379,7 @@ class MessagesView extends React.Component {
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("Failed subscription to", this.state.topic);
|
||||
console.error("Failed subscription to", this.state.topic);
|
||||
this.props.onError(err.message, 'err');
|
||||
const blankState = MessagesView.getDerivedStateFromProps({}, {});
|
||||
blankState.title = this.props.intl.formatMessage(messages.not_found);
|
||||
@@ -600,7 +600,7 @@ class MessagesView extends React.Component {
|
||||
this.forceUpdate();
|
||||
break;
|
||||
default:
|
||||
console.log("Other change in topic: ", info.what);
|
||||
console.info("Other change in topic: ", info.what);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -636,7 +636,7 @@ class MessagesView extends React.Component {
|
||||
url.search = params;
|
||||
window.open(url, '_blank');
|
||||
} else {
|
||||
console.log("Unknown action in form", action);
|
||||
console.info("Unknown action in form", action);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -884,10 +884,10 @@ class MessagesView extends React.Component {
|
||||
}
|
||||
|
||||
// Make small image previews.
|
||||
const ents = [];
|
||||
const images = [];
|
||||
Drafty.entities(content, (data, idx, tp) => {
|
||||
if (tp == 'IM') {
|
||||
ents.push({
|
||||
images.push({
|
||||
tp: tp,
|
||||
data: data
|
||||
});
|
||||
@@ -895,7 +895,7 @@ class MessagesView extends React.Component {
|
||||
});
|
||||
|
||||
// Turn all images into thumbnails.
|
||||
const promises = ents.map((ex) => {
|
||||
const promises = images.map((ex) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const handleFailure = () => {
|
||||
ex.data.val = '';
|
||||
@@ -978,7 +978,7 @@ class MessagesView extends React.Component {
|
||||
ref.current.classList.add('flash');
|
||||
setTimeout(() => { ref.current.classList.remove('flash') } , 1000);
|
||||
} else {
|
||||
console.error("Unresolved message ref: seqId", replyToSeq);
|
||||
console.error("Unresolved message ref", replyToSeq);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class BaseChatMessage extends React.PureComponent {
|
||||
let content = this.props.content;
|
||||
const attachments = [];
|
||||
if (this.props.mimeType == Drafty.getContentType() && Drafty.isValid(content)) {
|
||||
Drafty.attachments(content, function(att, i) {
|
||||
Drafty.attachments(content, (att, i) => {
|
||||
if (att.mime == 'application/json') {
|
||||
// Don't show json objects as attachments.
|
||||
// They are not meant for users.
|
||||
|
||||
Reference in New Issue
Block a user