aboutsummaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2020-11-12 12:09:51 -0500
committerDrew DeVault <sir@cmpwn.com>2020-11-12 12:09:51 -0500
commit5268eba101e1919e2ced0385c51c58b14b8ed668 (patch)
tree3f82948ab9d258a25b91f27ad05a4a44124b739b /themes
parentaad5f44f6cb605589fa017bc521e47a4a517b57d (diff)
downloadalps-5268eba101e1919e2ced0385c51c58b14b8ed668.tar.gz
alps-5268eba101e1919e2ced0385c51c58b14b8ed668.zip
Notify server when user discards attachment
Diffstat (limited to 'themes')
-rw-r--r--themes/alps/assets/attachments.js6
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();