fixed: unable to remove topic avatar
This commit is contained in:
+2
-2
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+3
-3
@@ -782,10 +782,10 @@ function vcard(fn, imageDataUrl) {
|
||||
|
||||
if (imageDataUrl) {
|
||||
var dataStart = imageDataUrl.indexOf(',');
|
||||
card.photo = {
|
||||
card.photo = dataStart >= 0 ? {
|
||||
data: imageDataUrl.substring(dataStart + 1),
|
||||
type: 'jpg'
|
||||
};
|
||||
} : imageDataUrl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1972,7 +1972,7 @@ var InfoView = function (_React$Component) {
|
||||
this.setState({
|
||||
avatar: img
|
||||
});
|
||||
this.props.onTopicDescUpdate(this.props.topic, Object(_lib_utils_js__WEBPACK_IMPORTED_MODULE_15__["vcard"])(null, img), null);
|
||||
this.props.onTopicDescUpdate(this.props.topic, Object(_lib_utils_js__WEBPACK_IMPORTED_MODULE_15__["vcard"])(null, img || tinode_sdk__WEBPACK_IMPORTED_MODULE_2___default.a.DEL_CHAR), null);
|
||||
}
|
||||
}, {
|
||||
key: "handleMuted",
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user