Fix crashing when uri has spaces
This commit is contained in:
parent
becc1fcaf5
commit
27bc209717
1 changed files with 1 additions and 1 deletions
|
@ -22,7 +22,7 @@ function ModalRepost(props: Props) {
|
||||||
|
|
||||||
const urlParams = new URLSearchParams(search);
|
const urlParams = new URLSearchParams(search);
|
||||||
const param = urlParams.get('name') || urlParams.get('q') || contentName;
|
const param = urlParams.get('name') || urlParams.get('q') || contentName;
|
||||||
const repostTo = param && param[0] === '@' ? param.slice(1) : param;
|
const repostTo = param && (param[0] === '@' ? param.slice(1) : param.replace(/\s/g, '')); // remove spaces
|
||||||
|
|
||||||
const [contentUri, setContentUri] = React.useState('');
|
const [contentUri, setContentUri] = React.useState('');
|
||||||
const [repostUri, setRepostUri] = React.useState('');
|
const [repostUri, setRepostUri] = React.useState('');
|
||||||
|
|
Loading…
Reference in a new issue