Update JS code structure

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

View File

@ -12,12 +12,12 @@ nopaque.resource_lists.JobList = class JobList extends nopaque.resource_lists.Re
this.selectedItemIds = new Set();
this.userId = listContainerElement.dataset.userId;
if (this.userId === undefined) {return;}
app.subscribeUser(this.userId).then((response) => {
app.socket.on('patch_user', (patch) => {
app.users.subscribe(this.userId).then((response) => {
app.socket.on('users.patch', (patch) => {
if (this.isInitialized) {this.onPatch(patch);}
});
});
app.getUser(this.userId).then((user) => {
app.users.get(this.userId).then((user) => {
this.add(Object.values(user.jobs));
this.isInitialized = true;
});