mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-05 20:15:01 +00:00
Merge branch 'dev'
This commit is contained in:
commit
c5fc5cc9d0
2 changed files with 6 additions and 2 deletions
6
ui/src/components/comment-form.tsx
vendored
6
ui/src/components/comment-form.tsx
vendored
|
@ -225,13 +225,15 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
.then(res => res.json())
|
||||
.then(res => {
|
||||
let url = `${window.location.origin}/pictshare/${res.url}`;
|
||||
let markdown =
|
||||
let imageMarkdown =
|
||||
res.filetype == 'mp4' ? `[vid](${url}/raw)` : `![](${url})`;
|
||||
let content = i.state.commentForm.content;
|
||||
content = content ? `${content} ${markdown}` : markdown;
|
||||
content = content ? `${content}\n${imageMarkdown}` : imageMarkdown;
|
||||
i.state.commentForm.content = content;
|
||||
i.state.imageLoading = false;
|
||||
i.setState(i.state);
|
||||
var textarea: any = document.getElementById(i.id);
|
||||
autosize.update(textarea);
|
||||
})
|
||||
.catch(error => {
|
||||
i.state.imageLoading = false;
|
||||
|
|
2
ui/src/utils.ts
vendored
2
ui/src/utils.ts
vendored
|
@ -382,6 +382,8 @@ export function toast(text: string, background: string = 'success') {
|
|||
Toastify({
|
||||
text: text,
|
||||
backgroundColor: backgroundColor,
|
||||
gravity: 'bottom',
|
||||
position: 'left',
|
||||
}).showToast();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue