I am using primeng ConfirmationService to display confirm dialog. After the first dialog is confirmed, i want to display another dialog based on a condition. But it is not working. Here is my code. Can anyone help me how to solve this?
this.confirmDialog.confirm({
header: 'Begin',
message: 'Are you sure you would like to start?',
acceptLabel: 'Yes',
rejectLabel: 'No',
accept: () => {
if(this.currentUserId !== workflow.assignedToId) {
this.confirmDialog.confirm({
header: 'Reassign',
message: 'reassign it to yourself?',
acceptLabel: 'Yes',
rejectLabel: 'No',
accept: () => {
console.log('accept 2 diffeent user');
},
reject: () => {
console.log('reject 2 diffeent user');
}
})
} else {
console.log('accept 1 same user');
}
},
reject: () => {
console.log('reject 1 same user');
}
})