instauto 9.1.1 → 9.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instauto",
3
- "version": "9.1.1",
3
+ "version": "9.1.2",
4
4
  "description": "Instagram automation library written in Node.js",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -646,13 +646,13 @@ const Instauto = async (db, browser, options) => {
646
646
  return;
647
647
  }
648
648
 
649
- if (enableFollow) {
650
- if (await followUserRespectingRestrictions({ username: follower, skipPrivate })) {
651
- numFollowedForThisUser += 1;
652
- }
653
- }
649
+ let didActuallyFollow = false;
650
+ if (enableFollow) didActuallyFollow = await followUserRespectingRestrictions({ username: follower, skipPrivate });
651
+ if (didActuallyFollow) numFollowedForThisUser += 1;
652
+
653
+ const didFailToFollow = enableFollow && !didActuallyFollow;
654
654
 
655
- if (enableLikeImages) {
655
+ if (enableLikeImages && !didFailToFollow) {
656
656
  // Note: throws error if user isPrivate
657
657
  await likeUserImages({ username: follower, likeImagesMin, likeImagesMax });
658
658
  }