client/upload: force enable 'upload anonymously' for anon users

Fixes #425
This commit is contained in:
Shyam Sunder 2021-09-13 14:24:07 -04:00
parent be0c867d25
commit f58079e12e
2 changed files with 4 additions and 1 deletions

View file

@ -61,6 +61,7 @@
text: 'Upload anonymously',
name: 'anonymous',
checked: ctx.uploadable.anonymous,
readonly: ctx.uploadable.forceAnonymous,
}) %>
</div>
<% } %>

View file

@ -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() {}