Add getUncommitedStates()
This commit is contained in:
parent
deebcefc3d
commit
5a8c31df32
@ -1473,6 +1473,13 @@ export default class Services {
|
||||
return null;
|
||||
}
|
||||
|
||||
public getUncommitedStates(process: Process): ProcessState[] {
|
||||
if (process.states.length === 0) return [];
|
||||
const processTip = process.states[process.states.length - 1].commited_in;
|
||||
const res = process.states.filter(state => state.commited_in === processTip);
|
||||
return res.filter(state => state.state_id !== EMPTY32BYTES);
|
||||
}
|
||||
|
||||
public getStateFromId(process: Process, stateId: string): ProcessState | null {
|
||||
if (process.states.length === 0) return null;
|
||||
const state = process.states.find(state => state.state_id === stateId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user