diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-11-12 12:09:51 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-11-12 12:09:51 -0500 |
commit | 5268eba101e1919e2ced0385c51c58b14b8ed668 (patch) | |
tree | 3f82948ab9d258a25b91f27ad05a4a44124b739b /themes/alps/assets | |
parent | aad5f44f6cb605589fa017bc521e47a4a517b57d (diff) | |
download | alps-5268eba101e1919e2ced0385c51c58b14b8ed668.tar.gz alps-5268eba101e1919e2ced0385c51c58b14b8ed668.zip |
Notify server when user discards attachment
Diffstat (limited to 'themes/alps/assets')
-rw-r--r-- | themes/alps/assets/attachments.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/themes/alps/assets/attachments.js b/themes/alps/assets/attachments.js index 612808a..dc6cc04 100644 --- a/themes/alps/assets/attachments.js +++ b/themes/alps/assets/attachments.js @@ -80,6 +80,12 @@ function attachFile(file) { attachments = attachments.filter(a => a !== attachment); node.remove(); updateState(); + + if (typeof attachment.uuid !== "undefined") { + const cancel = new XMLHttpRequest(); + cancel.open("POST", `/compose/attachment/${attachment.uuid}/remove`); + cancel.send(); + } }); let formData = new FormData(); |