mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-23 05:13:04 +03:00
Merge pull request #619 from esteemapp/bugfix/#580
Fixed image upload error
This commit is contained in:
commit
50767e2191
@ -30,11 +30,18 @@ export default ({
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
newText = replaceBetween(text, selection, `${imagePrefix}[${itemText}](${itemUrl})`);
|
newText = replaceBetween(text, selection, `${imagePrefix}[${itemText}](${itemUrl})`);
|
||||||
|
if (isImage) {
|
||||||
|
newSelection = {
|
||||||
|
start: newText && newText.length,
|
||||||
|
end: newText && newText.length,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
newSelection = {
|
newSelection = {
|
||||||
start: selection.start + 1,
|
start: selection.start + 1,
|
||||||
end: selection.start + 1 + itemText && itemText.length,
|
end: selection.start + 1 + (itemText && itemText.length),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
setState({ text: newText }, () => {
|
setState({ text: newText }, () => {
|
||||||
setState({ newSelection });
|
setState({ newSelection });
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user