Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: can't go previous stories when stories has ended #278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

func-void
Copy link

@func-void func-void commented Apr 19, 2023

Reproduce:

trying with this link https://stackblitz.com/edit/react-insta-stories-mr9yer?file=src%2FApp.js with the latest version

  • when stories have finished, then when I want to go to previous stories, the stories won't back to the previous.
  • props loop={false]

and when i look at the code, i found this on components/Container.tsx

my suggestion in func

  const setCurrentIdWrapper = (callback) => {
    setCurrentId(callback);
    toggleState("pause", true);
  };

and

  const mouseUp =
    (type: string) => (e: React.MouseEvent | React.TouchEvent) => {
      e.preventDefault();
      mousedownId.current && clearTimeout(mousedownId.current);
      if (pause) {
        toggleState("play");
      } else {
        type === "next" ? next() : previous();
      }
    };

when i try to modify the mouseUp func, the problem is if i hold for a pause in the next area, when i up the mouse, function next() will triggered, and otherwise

so i choose remove toggleState("pause", true); on setCurrentIdWrapper func instead

@vercel
Copy link

vercel bot commented Apr 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-insta-stories ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2023 11:59am

Copy link

@AleTid5 AleTid5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants