[Glitch] Add attachment list fallback to public pages

Port JS changes from bb2dbd681f to glitch-soc
This commit is contained in:
Thibaut Girka 2019-01-13 14:42:50 +01:00
parent ff721e2d49
commit 456c0aa9cc

View file

@ -61,6 +61,12 @@ function main() {
if (reactComponents.length > 0) { if (reactComponents.length > 0) {
import(/* webpackChunkName: "containers/media_container" */ 'flavours/glitch/containers/media_container') import(/* webpackChunkName: "containers/media_container" */ 'flavours/glitch/containers/media_container')
.then(({ default: MediaContainer }) => { .then(({ default: MediaContainer }) => {
[].forEach.call(reactComponents, (component) => {
[].forEach.call(component.children, (child) => {
component.removeChild(child);
});
});
const content = document.createElement('div'); const content = document.createElement('div');
ReactDOM.render(<MediaContainer locale={locale} components={reactComponents} />, content); ReactDOM.render(<MediaContainer locale={locale} components={reactComponents} />, content);