From b8699d59d2fdbdf9975ef408745458b4997a6adf Mon Sep 17 00:00:00 2001 From: neobooru <50623835+neobooru@users.noreply.github.com> Date: Tue, 23 Jul 2019 01:20:42 +0200 Subject: [PATCH] client/upload: automatically set source when uploading from url Fixes #230 --- client/js/controllers/post_upload_controller.js | 3 +++ 1 file changed, 3 insertions(+) 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; } }