diff options
Diffstat (limited to 'ui/src/components/post-form.tsx')
-rw-r--r-- | ui/src/components/post-form.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx index 7811f918..d424538b 100644 --- a/ui/src/components/post-form.tsx +++ b/ui/src/components/post-form.tsx @@ -35,6 +35,7 @@ import { setupTribute, setupTippy, emojiPicker, + pictrsDeleteToast, } from '../utils'; import autosize from 'autosize'; import Tribute from 'tributejs/src/Tribute.js'; @@ -536,9 +537,16 @@ export class PostForm extends Component<PostFormProps, PostFormState> { if (res.msg == 'ok') { let hash = res.files[0].file; let url = `${window.location.origin}/pictrs/image/${hash}`; + let deleteToken = res.files[0].delete_token; + let deleteUrl = `${window.location.origin}/pictrs/image/delete/${deleteToken}/${hash}`; i.state.postForm.url = url; i.state.imageLoading = false; i.setState(i.state); + pictrsDeleteToast( + i18n.t('click_to_delete_picture'), + i18n.t('picture_deleted'), + deleteUrl + ); } else { i.state.imageLoading = false; i.setState(i.state); |