diff --git a/api-server/src/server/boot/settings.js b/api-server/src/server/boot/settings.js index fd3f07f6fcc..bb9b035bcc4 100644 --- a/api-server/src/server/boot/settings.js +++ b/api-server/src/server/boot/settings.js @@ -179,7 +179,7 @@ function updateMyAbout(req, res, next) { // prevent dataurls from being stored const update = isURL(picture, { require_protocol: true }) ? { name, location, about, picture } - : { name, location, about }; + : { name, location, about, picture: '' }; return user.updateAttributes( update, createStandardHandler(req, res, next, 'flash.updated-about-me') diff --git a/api/src/routes/settings.ts b/api/src/routes/settings.ts index 0b575d9e128..065df49a18b 100644 --- a/api/src/routes/settings.ts +++ b/api/src/routes/settings.ts @@ -494,7 +494,7 @@ ${isLinkSentWithinLimitTTL}` about: req.body.about, name: req.body.name, location: req.body.location, - ...(hasProtocol && { picture: req.body.picture }) + picture: hasProtocol ? req.body.picture : '' } }); diff --git a/client/src/components/settings/about.tsx b/client/src/components/settings/about.tsx index 0450f298938..63bc2a4cd04 100644 --- a/client/src/components/settings/about.tsx +++ b/client/src/components/settings/about.tsx @@ -165,7 +165,11 @@ class AboutSettings extends Component { handlePictureChange = (e: React.ChangeEvent) => { const value = (e.target as HTMLInputElement).value.slice(0); - if (isURL(value, { require_protocol: true })) { + if (!value) { + this.setState({ + isPictureUrlValid: true + }); + } else if (isURL(value, { require_protocol: true })) { this.validationImage.src = encodeURI(value); } else { this.setState({