Fix getRoles
This commit is contained in:
parent
f50bdafc80
commit
a578808393
@ -641,6 +641,7 @@ class ChatElement extends HTMLElement {
|
|||||||
const service = await Services.getInstance();
|
const service = await Services.getInstance();
|
||||||
// Get the `commited_in` value of the last state and remove it from the array
|
// Get the `commited_in` value of the last state and remove it from the array
|
||||||
const currentCommitedIn = process.states.pop()?.commited_in;
|
const currentCommitedIn = process.states.pop()?.commited_in;
|
||||||
|
console.log('Current CommitedIn (roles):' currentCommitedIn);
|
||||||
|
|
||||||
if (currentCommitedIn === undefined) {
|
if (currentCommitedIn === undefined) {
|
||||||
return null; // No states available
|
return null; // No states available
|
||||||
@ -651,12 +652,19 @@ class ChatElement extends HTMLElement {
|
|||||||
state => state.commited_in !== currentCommitedIn
|
state => state.commited_in !== currentCommitedIn
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if (!lastDifferentState) {
|
if (!lastDifferentState) {
|
||||||
// It means that we only have one state that is not commited yet, that can happen with process we just created
|
// It means that we only have one state that is not commited yet, that can happen with process we just created
|
||||||
// let's assume that the right description is in the last concurrent state and not handle the (arguably rare) case where we have multiple concurrent states on a creation
|
// let's assume that the right description is in the last concurrent state and not handle the (arguably rare) case where we have multiple concurrent states on a creation
|
||||||
lastDifferentState = process.states.pop();
|
lastDifferentState = process.states.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!lastDifferentState.pcd_commitment) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('lastDifferentState (roles):'lastDifferentState);
|
||||||
|
|
||||||
// Take the roles out of the state
|
// Take the roles out of the state
|
||||||
const roles = lastDifferentState!.pcd_commitment['roles'];
|
const roles = lastDifferentState!.pcd_commitment['roles'];
|
||||||
if (roles) {
|
if (roles) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user