Further js refactoring

This commit is contained in:
Patrick Jentsch
2024-12-05 14:26:05 +01:00
parent df2bffe0fd
commit c97b2a886e
18 changed files with 110 additions and 68 deletions

View File

@ -6,10 +6,10 @@ nopaque.resource_displays.ResourceDisplay = class ResourceDisplay {
this.userId = this.displayElement.dataset.userId;
this.isInitialized = false;
if (this.userId === undefined) {return;}
app.liveUserRegistry.addEventListener('patch', (event) => {
app.userHub.addEventListener('patch', (event) => {
if (this.isInitialized) {this.onPatch(event.detail);}
});
app.liveUserRegistry.get(this.userId).then((user) => {
app.userHub.get(this.userId).then((user) => {
this.init(user);
this.isInitialized = true;
});