Update JS code structure

This commit is contained in:
Patrick Jentsch committed 2024-12-02 09:34:17 +01:00
1 parent a2904caea2
commit 12a3ac1d5d
21 files changed
+295 -242

No files matched your search

@@ -6,13 +6,13 @@ nopaque.resource_displays.ResourceDisplay = class ResourceDisplay {
this.userId = this.displayElement.dataset.userId;
this.isInitialized = false;
if (this.userId) {
app.subscribeUser(this.userId)
app.users.subscribe(this.userId)
.then((response) => {
app.socket.on('patch_user', (patch) => {
app.socket.on('users.patch', (patch) => {
if (this.isInitialized) {this.onPatch(patch);}
});
});
app.getUser(this.userId)
app.users.get(this.userId)
.then((user) => {
this.init(user);
this.isInitialized = true;