diff --git a/app/static/js/ResourceLists/CorpusFileList.js b/app/static/js/ResourceLists/CorpusFileList.js index ca27fe27..c052b2ea 100644 --- a/app/static/js/ResourceLists/CorpusFileList.js +++ b/app/static/js/ResourceLists/CorpusFileList.js @@ -11,6 +11,7 @@ class CorpusFileList extends ResourceList { this.isInitialized = false; this.userId = listContainerElement.dataset.userId; this.corpusId = listContainerElement.dataset.corpusId; + if (this.userId === undefined || this.corpusId === undefined) {return;} app.subscribeUser(this.userId).then((response) => { app.socket.on('PATCH', (patch) => { if (this.isInitialized) {this.onPatch(patch);} diff --git a/app/static/js/ResourceLists/CorpusList.js b/app/static/js/ResourceLists/CorpusList.js index e4af0b12..bf62ebed 100644 --- a/app/static/js/ResourceLists/CorpusList.js +++ b/app/static/js/ResourceLists/CorpusList.js @@ -8,8 +8,9 @@ class CorpusList extends ResourceList { constructor(listContainerElement, options = {}) { super(listContainerElement, options); this.listjs.list.addEventListener('click', (event) => {this.onClick(event)}); - this.isInitialized = false; + this.isInitialized = false this.userId = listContainerElement.dataset.userId; + if (this.userId === undefined) {return;} app.subscribeUser(this.userId).then((response) => { app.socket.on('PATCH', (patch) => { if (this.isInitialized) {this.onPatch(patch);} diff --git a/app/static/js/ResourceLists/JobInputList.js b/app/static/js/ResourceLists/JobInputList.js index 36cb47f7..7f1a5105 100644 --- a/app/static/js/ResourceLists/JobInputList.js +++ b/app/static/js/ResourceLists/JobInputList.js @@ -11,6 +11,7 @@ class JobInputList extends ResourceList { this.isInitialized = false; this.userId = listContainerElement.dataset.userId; this.jobId = listContainerElement.dataset.jobId; + if (this.userId === undefined || this.jobId === undefined) {return;} app.subscribeUser(this.userId).then((response) => { app.socket.on('PATCH', (patch) => { if (this.isInitialized) {this.onPatch(patch);} diff --git a/app/static/js/ResourceLists/JobList.js b/app/static/js/ResourceLists/JobList.js index 1fa14ea2..ff7f82b2 100644 --- a/app/static/js/ResourceLists/JobList.js +++ b/app/static/js/ResourceLists/JobList.js @@ -10,6 +10,7 @@ class JobList extends ResourceList { this.listjs.list.addEventListener('click', (event) => {this.onClick(event)}); this.isInitialized = false; this.userId = listContainerElement.dataset.userId; + if (this.userId === undefined) {return;} app.subscribeUser(this.userId).then((response) => { app.socket.on('PATCH', (patch) => { if (this.isInitialized) {this.onPatch(patch);} diff --git a/app/static/js/ResourceLists/JobResultList.js b/app/static/js/ResourceLists/JobResultList.js index 71c430af..b0cbc088 100644 --- a/app/static/js/ResourceLists/JobResultList.js +++ b/app/static/js/ResourceLists/JobResultList.js @@ -11,6 +11,7 @@ class JobResultList extends ResourceList { this.isInitialized = false; this.userId = listContainerElement.dataset.userId; this.jobId = listContainerElement.dataset.jobId; + if (this.userId === undefined || this.jobId === undefined) {return;} app.subscribeUser(this.userId).then((response) => { app.socket.on('PATCH', (patch) => { if (this.isInitialized) {this.onPatch(patch);} diff --git a/app/static/js/ResourceLists/SpacyNLPPipelineModelList.js b/app/static/js/ResourceLists/SpacyNLPPipelineModelList.js index 078ec90c..b90fb06b 100644 --- a/app/static/js/ResourceLists/SpacyNLPPipelineModelList.js +++ b/app/static/js/ResourceLists/SpacyNLPPipelineModelList.js @@ -11,6 +11,7 @@ class SpaCyNLPPipelineModelList extends ResourceList { this.listjs.list.addEventListener('click', (event) => {this.onClick(event)}); this.isInitialized = false; this.userId = listContainerElement.dataset.userId; + if (this.userId === undefined) {return;} app.subscribeUser(this.userId).then((response) => { app.socket.on('PATCH', (patch) => { if (this.isInitialized) {this.onPatch(patch);} diff --git a/app/static/js/ResourceLists/TesseractOCRPipelineModelList.js b/app/static/js/ResourceLists/TesseractOCRPipelineModelList.js index ad319041..4ad3f5b1 100644 --- a/app/static/js/ResourceLists/TesseractOCRPipelineModelList.js +++ b/app/static/js/ResourceLists/TesseractOCRPipelineModelList.js @@ -11,6 +11,7 @@ class TesseractOCRPipelineModelList extends ResourceList { this.listjs.list.addEventListener('click', (event) => {this.onClick(event)}); this.isInitialized = false; this.userId = listContainerElement.dataset.userId; + if (this.userId === undefined) {return;} app.subscribeUser(this.userId).then((response) => { app.socket.on('PATCH', (patch) => { if (this.isInitialized) {this.onPatch(patch);}