Improve video scrolling by using the new speed setting
Update the scrolling logic in the `CategoryRow` component to correctly utilize the `newSpeed` variable for determining scroll speed. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/QCN70f2
This commit is contained in:
parent
7c0ce0ed27
commit
a840f458cf
@ -164,8 +164,8 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
||||
|
||||
scrollIntervalRef.current = setInterval(() => {
|
||||
setTranslateX(prev => {
|
||||
// Use current speed mode for toggle function only
|
||||
const currentSpeed = speedMode === 'fast' ? 3.5 : 2.0;
|
||||
// Use the NEW speed that was just set
|
||||
const currentSpeed = newSpeed === 'fast' ? 3.5 : 2.0;
|
||||
const speed = direction === 'right' ? -currentSpeed : currentSpeed;
|
||||
const newX = prev + speed;
|
||||
const totalWidth = category.videos.length * videoWidth;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user