fixed: unable to remove topic avatar

This commit is contained in:
or-else
2019-08-01 09:49:26 +03:00
parent 7239aae8aa
commit 40edad1c99
6 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -28,10 +28,10 @@ export function vcard(fn, imageDataUrl) {
}
if (imageDataUrl) {
const dataStart = imageDataUrl.indexOf(',');
card.photo = {
card.photo = dataStart >= 0 ? {
data: imageDataUrl.substring(dataStart+1),
type: 'jpg'
};
} : imageDataUrl;
}
}
return card;
+1 -1
View File
@@ -238,7 +238,7 @@ class InfoView extends React.Component {
handleImageChanged(img) {
this.setState({avatar: img});
this.props.onTopicDescUpdate(this.props.topic, vcard(null, img), null);
this.props.onTopicDescUpdate(this.props.topic, vcard(null, img || Tinode.DEL_CHAR), null);
}
handleMuted(ignored, checked) {