Change the user session SocketIO Logic

This commit is contained in:
Patrick Jentsch
2022-07-04 14:09:17 +02:00
parent b8bf004684
commit 76924956de
20 changed files with 200 additions and 99 deletions

View File

@ -16,7 +16,7 @@ class CorpusDisplay extends RessourceDisplay {
this.setNumTokens(corpus.num_tokens);
}
usersPatchHandler(patch) {
onPATCH(patch) {
let filteredPatch;
let operation;
let re;

View File

@ -18,7 +18,7 @@ class JobDisplay extends RessourceDisplay {
this.setTitle(job.title);
}
usersPatchHandler(patch) {
onPATCH(patch) {
let filteredPatch;
let operation;
let re;

View File

@ -2,13 +2,13 @@ class RessourceDisplay {
constructor(displayElement) {
this.displayElement = displayElement;
this.userId = this.displayElement.dataset.userId;
app.addEventListener('users.patch', patch => this.usersPatchHandler(patch));
app.getUserById(this.userId).then(user => this.init(user));
app.socket.on('PATCH', (patch) => {this.onPATCH(patch);});
app.subscribeUser(this.userId).then((user) => {this.init(user);});
}
init(user) {throw 'Not implemented';}
usersPatchHandler(patch) {throw 'Not implemented';}
onPATCH(patch) {throw 'Not implemented';}
setElement(element, value) {
switch (element.tagName) {