summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneobooru <50623835+neobooru@users.noreply.github.com>2019-07-23 01:20:42 +0200
committerneobooru <50623835+neobooru@users.noreply.github.com>2019-07-23 01:20:42 +0200
commitb8699d59d2fdbdf9975ef408745458b4997a6adf (patch)
treef2c69cc6e9fc6b89b574ef861dcf9da155f15029
parent2484aef492f909b4241808c6faa303f08f7ed654 (diff)
client/upload: automatically set source when uploading from url
Fixes #230
-rw-r--r--client/js/controllers/post_upload_controller.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/client/js/controllers/post_upload_controller.js b/client/js/controllers/post_upload_controller.js
index ccd6f94..1124ff7 100644
--- a/client/js/controllers/post_upload_controller.js
+++ b/client/js/controllers/post_upload_controller.js
@@ -151,6 +151,9 @@ class PostUploadController {
}
post.relations = uploadable.relations;
post.newContent = uploadable.url || uploadable.file;
+ // if uploadable.source is ever going to be a valid field (e.g when setting source directly in the upload window)
+ // you'll need to change the line below to `post.source = uploadable.source || uploadable.url;`
+ if (uploadable.url) post.source = uploadable.url;
return post;
}
}