I have two promises which are chained as below ,
var promise1;
var promise2 = promise1.then(function() {
});
Now I have a condition that promise1 will be executed based on a condition i.e
if(userid == 123) {
promise1 should execute.
}
How do I chain promise1 and promise2 in this particular case where as I always need promise2 to be executed ?