Catch invalid roles in getProcessesWhereTheCurrentMemberIs()
This commit is contained in:
parent
f1f736738f
commit
f857422920
@ -1420,18 +1420,12 @@ class ChatElement extends HTMLElement {
|
|||||||
const processes = await service.getProcesses();
|
const processes = await service.getProcesses();
|
||||||
|
|
||||||
for (const [processId, process] of Object.entries(processes)) {
|
for (const [processId, process] of Object.entries(processes)) {
|
||||||
console.log(processId);
|
|
||||||
console.log(process);
|
|
||||||
let roles;
|
let roles;
|
||||||
try {
|
try {
|
||||||
roles = await this.getRoles(process);
|
roles = await this.getRoles(process);
|
||||||
if (!roles) {
|
if (!roles) {
|
||||||
roles = await process.states[0].encrypted_pcd.roles;
|
roles = await process.states[0].encrypted_pcd.roles;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
console.error('Failed to get roles for process:', processId);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasCurrentUser = Object.values(roles).some(role =>
|
const hasCurrentUser = Object.values(roles).some(role =>
|
||||||
(role as { members: { sp_addresses: string[] }[] }).members
|
(role as { members: { sp_addresses: string[] }[] }).members
|
||||||
@ -1442,6 +1436,10 @@ class ChatElement extends HTMLElement {
|
|||||||
this.userProcessSet.add(processId);
|
this.userProcessSet.add(processId);
|
||||||
console.log("Ajout du process au Set:", processId);
|
console.log("Ajout du process au Set:", processId);
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.userProcessSet;
|
return this.userProcessSet;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user