links: prevents title from being overwritten
fixes
@@ -83,11 +83,11 @@ export class LinkSubmit extends Component<LinkSubmitProps, LinkSubmitState> {
fetch(`https://noembed.com/embed?url=${linkValue}`)
.then(response => response.json())
.then((result) => {
- if (result.title) {
+ if (result.title && !this.state.linkTitle) {
this.setState({ linkTitle: result.title });
}
}).catch((error) => {/*noop*/});
- } else {
+ } else if (!this.state.linkTitle) {
this.setState({
linkTitle: decodeURIComponent(linkValue
.split('/')
