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

Animation continued after unsuccessful "toPreviousStory" call #43

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "src/index.tsx",
"source": "src/index.tsx",
"scripts": {
"prepare": "husky install",
"build": "tsc -p tsconfig.json",
"release": "standard-version",
"test": "jest --coverage"
Expand Down
14 changes: 13 additions & 1 deletion src/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ const StoryModal = forwardRef<StoryModalPublicMethods, StoryModalProps>( ( {

scrollTo( previousUserId.value );

} else {

return false;

}

} else {
Expand All @@ -225,6 +229,8 @@ const StoryModal = forwardRef<StoryModalPublicMethods, StoryModalProps>( ( {

}

return true;

};

const show = ( id: string ) => {
Expand Down Expand Up @@ -342,7 +348,13 @@ const StoryModal = forwardRef<StoryModalPublicMethods, StoryModalProps>( ( {

} else if ( ( pressInformation.value.x ) < WIDTH / 2 ) {

toPreviousStory();
const success = toPreviousStory();

if ( !success ) {

startAnimation( true );

}

} else {

Expand Down