Skip to content

Commit

Permalink
fix: track loops
Browse files Browse the repository at this point in the history
  • Loading branch information
Chickensoupwithrice committed Sep 14, 2023
1 parent facc0af commit 659f505
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/site/facebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export class FacebookTimelineBehavior {
firstPhoto.click();
await sleep(waitUnit * 5);
await waitUntil(() => window.location.href !== lastHref, waitUnit * 2);
const firstPhotoHref = window.location.href;

let nextSlideButton = null;

Expand All @@ -290,7 +291,8 @@ export class FacebookTimelineBehavior {
sleep(3000)
]);

if (window.location.href === lastHref) {
// Exit once we've looped
if (window.location.href === firstPhotoHref) {
break;
}

Expand Down

0 comments on commit 659f505

Please sign in to comment.