]> Untitled Git - lemmy-ui.git/commitdiff
Fixing up popup code.
authorDessalines <tyhou13@gmx.com>
Fri, 21 Oct 2022 18:14:28 +0000 (14:14 -0400)
committerDessalines <tyhou13@gmx.com>
Fri, 21 Oct 2022 18:14:28 +0000 (14:14 -0400)
lemmy-translations
src/shared/components/common/markdown-textarea.tsx
src/shared/components/post/post-form.tsx
src/shared/utils.ts

index ae3132fef13542ab7fc337361bf484183d12d786..94b9b5debdaa40facf13a852cb096ef0cbd34ad7 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ae3132fef13542ab7fc337361bf484183d12d786
+Subproject commit 94b9b5debdaa40facf13a852cb096ef0cbd34ad7
index 33447eb6f57fe427ca3daa63cd6d475a4a0e6b98..8cdfaadc33b0dafd82aee0241ee037681b3bf9f1 100644 (file)
@@ -386,9 +386,9 @@ export class MarkdownTextArea extends Component<
           let textarea: any = document.getElementById(i.id);
           autosize.update(textarea);
           pictrsDeleteToast(
-            i18n.t("click_to_delete_picture").concat(' (', file.name,')'),
-            i18n.t("picture_deleted").concat(' (', file.name,')'),
-            i18n.t("fail_picture_deleted").concat(' (', file.name,')'),
+            `${i18n.t("click_to_delete_picture")}: ${file.name}`,
+            `${i18n.t("picture_deleted")}: ${file.name}`,
+            `${i18n.t("failed_to_delete_picture")}: ${file.name}`,
             deleteUrl
           );
         } else {
index 8addc859fc03bcba2303f85982bede3b35c43cd8..0f8ea0bbc11e068b1c95144a5d7213df0812aa75 100644 (file)
@@ -641,8 +641,9 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
           i.state.postForm.url = Some(url);
           i.setState({ imageLoading: false });
           pictrsDeleteToast(
-            i18n.t("click_to_delete_picture"),
-            i18n.t("picture_deleted"),
+            `${i18n.t("click_to_delete_picture")}: ${file.name}`,
+            `${i18n.t("picture_deleted")}: ${file.name}`,
+            `${i18n.t("failed_to_delete_picture")}: ${file.name}`,
             deleteUrl
           );
         } else {
index d0b9b4bf6de888d1802a9271aef856c0d6f870ad..b65c425235171c0f2fb73ea340672823b8d009bd 100644 (file)
@@ -553,16 +553,14 @@ export function pictrsDeleteToast(
       duration: 10000,
       onClick: () => {
         if (toast) {
-          fetch(deleteUrl, {})
-          .then( res => {
-            console.log(res)
+          fetch(deleteUrl).then(res => {
             toast.hideToast();
-            if (res.ok === true){
+            if (res.ok === true) {
               alert(deletePictureText);
-            } else{
+            } else {
               alert(failedDeletePictureText);
             }
-          })
+          });
         }
       },
       close: true,