Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/utils/libchat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export function injectLibchat() {
var libchatHash = "1e8f3119e6cff530e0d23e2cb1f2b2a7";
var div = document.createElement("div");
div.id = "libchat_" + libchatHash;
document.getElementsByTagName("body")[0].appendChild(div);
document.body.appendChild(div);
var scr = document.createElement("script");
scr.src = "https://libanswers.mit.edu/load_chat.php?hash=" + libchatHash;
// we added this error handling to the libanswers-provided script for libchat
scr.onerror = (ev) => {
console.error('Libchat script failed to load', scr.src, ev);
};
setTimeout(function () {
document.getElementsByTagName("body")[0].appendChild(scr);
document.body.appendChild(scr);
}, 2000);
} catch (e) {
console.error('error injecting libchat', e)
Expand Down
32 changes: 0 additions & 32 deletions src/app/utils/matomo.ts

This file was deleted.

6 changes: 2 additions & 4 deletions src/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import "@angular/compiler";
import { AppModule } from './app/app.module';
import { bootstrap } from "@angular-architects/module-federation-tools";
import { injectMatomo } from './app/utils/matomo';
import { injectLibchat } from "./app/utils/libchat";

export const bootstrapRemoteApp = (bootstrapOptions: any) => {
// Keep bootstrap minimal: always inject Matomo from helper.
injectMatomo();
injectLibchat();


return bootstrap(AppModule(bootstrapOptions), {
production: true,
appType: 'microfrontend'
}).then(r => {
console.log('custom remote app bootstrap success!', r);
injectLibchat();
return r
});
}
Expand Down