@@ -102,7 +102,7 @@ class Webshot extends CallableInstance {
const count = sensitiveToggles.length;
if (count)
logger.info(`found ${count} sensitive ${count === 1 ? 'tweet' : 'tweets'} on page, uncollapsing...`);
- return Promise.all(sensitiveToggles.map(toggle => toggle.click()));
+ return utils_1.chainPromises(sensitiveToggles.filter(toggle => toggle.isVisible()).map(toggle => () => toggle.click()));
})
.then(() => handle))
.catch((err) => {
@@ -130,7 +130,7 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
.then(sensitiveToggles => {
if (count) logger.info(`found ${count} sensitive ${count === 1 ? 'tweet' : 'tweets'} on page, uncollapsing...`);
+ return chainPromises(sensitiveToggles.filter(toggle => toggle.isVisible()).map(toggle => () => toggle.click()));
.then(() => handle)
)