clarkwinkelmann
I am running two instances, one for dev and other live, the dev instance does not work. Both are tested from the same browser. I don't have a valid cert on the dev instance, both sites get built from the same dockerfile and composer configs. There might be slight variation between enabled extensions, but no other significant changes. Only js error in dev console for the test instance is because I don't have a valid cert, so js sourcemap fails to load. Still digging, thought it might be an easy fix but appears not to be the case! 😆
DevTools failed to load SourceMap: Could not load content for forum-en-efbe8d61.js.map: Certificate error: net::ERR_CERT_COMMON_NAME_INVALID
In the flarum js loaded, for the avatar editor element, I am trying to figure out what would prevent this from executing or a specific condition that would cause it to fail without error.
, Ct = function(t) {
function e() {
return t.apply(this, arguments) || this
}
Object(r.a)(e, t);
var n = e.prototype;
return n.init = function() {
this.loading = !1,
this.isDraggedOver = !1
}
,
e.initProps = function(e) {
t.initProps.call(this, e),
e.className = e.className || ""
}
,
n.view = function() {
var t = this.props.user;
return m("div", {
className: "AvatarEditor Dropdown " + this.props.className + (this.loading ? " loading" : "") + (this.isDraggedOver ? " dragover" : "")
}, Object(x.a)(t), m("a", {
className: t.avatarUrl() ? "Dropdown-toggle" : "Dropdown-toggle AvatarEditor--noAvatar",
title: app.translator.trans("core.forum.user.avatar_upload_tooltip"),
"data-toggle": "dropdown",
onclick: this.quickUpload.bind(this),
ondragover: this.enableDragover.bind(this),
ondragenter: this.enableDragover.bind(this),
ondragleave: this.disableDragover.bind(this),
ondragend: this.disableDragover.bind(this),
ondrop: this.dropUpload.bind(this)
}, this.loading ? d.a.component() : t.avatarUrl() ? Object(v.a)("fas fa-pencil-alt") : Object(v.a)("fas fa-plus-circle")), m("ul", {
className: "Dropdown-menu Menu"
}, Object(T.a)(this.controlItems().toArray())))
}
,
n.controlItems = function() {
var t = new p.a;
return t.add("upload", C.a.component({
icon: "fas fa-upload",
children: app.translator.trans("core.forum.user.avatar_upload_button"),
onclick: this.openPicker.bind(this)
})),
t.add("remove", C.a.component({
icon: "fas fa-times",
children: app.translator.trans("core.forum.user.avatar_remove_button"),
onclick: this.remove.bind(this)
})),
t
}
,
n.enableDragover = function(t) {
t.preventDefault(),
t.stopPropagation(),
this.isDraggedOver = !0
}
,
n.disableDragover = function(t) {
t.preventDefault(),
t.stopPropagation(),
this.isDraggedOver = !1
}
,
n.dropUpload = function(t) {
t.preventDefault(),
t.stopPropagation(),
this.isDraggedOver = !1,
this.upload(t.dataTransfer.files[0])
}
,
n.quickUpload = function(t) {
this.props.user.avatarUrl() || (t.preventDefault(),
t.stopPropagation(),
this.openPicker())
}
,
n.openPicker = function() {
var t = this;
if (!this.loading) {
this.props.user;
$('<input type="file">').appendTo("body").hide().click().on("input", (function(e) {
t.upload($(e.target)[0].files[0])
}
))
}
}
,
n.upload = function(t) {
if (!this.loading) {
var e = this.props.user
, n = new FormData;
n.append("avatar", t),
this.loading = !0,
m.redraw(),
app.request({
method: "POST",
url: app.forum.attribute("apiUrl") + "/users/" + e.id() + "/avatar",
serialize: function(t) {
return t
},
data: n
}).then(this.success.bind(this), this.failure.bind(this))
}
}
,
n.remove = function() {
var t = this.props.user;
this.loading = !0,
m.redraw(),
app.request({
method: "DELETE",
url: app.forum.attribute("apiUrl") + "/users/" + t.id() + "/avatar"
}).then(this.success.bind(this), this.failure.bind(this))
}
,
n.success = function(t) {
app.store.pushPayload(t),
delete this.props.user.avatarColor,
this.loading = !1,
m.redraw()
}
,
n.failure = function(t) {
this.loading = !1,
m.redraw()
}
,
e
}
,