diff options
| author | Shyam Sunder <sgsunder1@gmail.com> | 2021-09-13 14:24:07 -0400 |
|---|---|---|
| committer | Shyam Sunder <sgsunder1@gmail.com> | 2021-09-13 14:24:07 -0400 |
| commit | f58079e12edd3c4dcc3f8b8dab572207b235aeff (patch) | |
| tree | 4fd185160ac13f6b95b1eb25bf93a4a96e3ee5e6 | |
| parent | be0c867d25897da50b6df1b969b7e21bca2fa888 (diff) | |
client/upload: force enable 'upload anonymously' for anon users
Fixes #425
| -rw-r--r-- | client/html/post_upload_row.tpl | 1 | ||||
| -rw-r--r-- | client/js/views/post_upload_view.js | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/client/html/post_upload_row.tpl b/client/html/post_upload_row.tpl index c7cc5db..2885e3d 100644 --- a/client/html/post_upload_row.tpl +++ b/client/html/post_upload_row.tpl @@ -61,6 +61,7 @@ text: 'Upload anonymously', name: 'anonymous', checked: ctx.uploadable.anonymous, + readonly: ctx.uploadable.forceAnonymous, }) %> </div> <% } %> diff --git a/client/js/views/post_upload_view.js b/client/js/views/post_upload_view.js index b92a9ae..7fdd4a4 100644 --- a/client/js/views/post_upload_view.js +++ b/client/js/views/post_upload_view.js @@ -1,6 +1,7 @@ "use strict"; const events = require("../events.js"); +const api = require("../api.js"); const views = require("../util/views.js"); const FileDropperControl = require("../controls/file_dropper_control.js"); @@ -34,7 +35,8 @@ class Uploadable extends events.EventTarget { this.flags = []; this.tags = []; this.relations = []; - this.anonymous = false; + this.anonymous = !api.isLoggedIn(); + this.forceAnonymous = !api.isLoggedIn(); } destroy() {} |