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
|
||||||
@ -650,6 +651,7 @@ class ChatElement extends HTMLElement {
|
|||||||
let lastDifferentState = process.states.findLast(
|
let lastDifferentState = process.states.findLast(
|
||||||
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
|
||||||
@ -657,6 +659,12 @@ class ChatElement extends HTMLElement {
|
|||||||
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