From f1f736738f3e5695b31383f3859cb57d11fe865c Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Thu, 30 Jan 2025 12:11:11 +0100 Subject: [PATCH] Fix getting roles in loadAllProcesses() --- src/pages/chat/chat.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pages/chat/chat.ts b/src/pages/chat/chat.ts index 3f2d897..bbcc18f 100755 --- a/src/pages/chat/chat.ts +++ b/src/pages/chat/chat.ts @@ -1045,7 +1045,16 @@ class ChatElement extends HTMLElement { const li = document.createElement('li'); li.className = 'group-list-item'; const oneProcess = process.states[0].commited_in; - const roles = process.states[0].encrypted_pcd.roles; + let roles; + try { + roles = await this.getRoles(process); + if (!roles) { + roles = await process.states[0].encrypted_pcd.roles; + } + } catch (e) { + // console.error('Failed to get roles for process:', process); + continue; + } // Si le processus est dans notre Set, ajouter la classe my-process if (this.userProcessSet && this.userProcessSet.has(oneProcess)) {