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

added button to play next video #814

Closed

Conversation

shantanuSakpal
Copy link

@shantanuSakpal shantanuSakpal commented Jul 8, 2024

PR Fixes:

  • There was no next button, to see the next video after finishing current.
  • There was no other video in the week 1 in local setup, so added a test video in week 1 in order to test the feature, thus modified seed.ts.

Resolves #811

Most of the code and functions were already written, but they were not used (weird). So i used them at appropriate place.
To be specific, i used the getNextVideo function in src/app/courses/[courseId]/[...moduleId]/page.tsx which was exported from src/db/course.ts
Also, when you click on next video button, it automatically marks the current video as "complete", and then redirects to next video.
In order to test it, i had to add another video in week 1, so just like the first video, i took a video link from w3schools
this one and modified seed.ts to add it in db.
image

Also, there were some warnings that were annoying me like use strokeLinecap instead, so fixed them too.

Also, modified .gitignore file, added ./idea folder. its a folder that is made when working in Webstorm IDE.

i more thing, when i ran npm run build, it gave the following error:


./src/actions/refresh-db/index.ts:32:7
Type error: This condition will always return true since this 'Promise<any>' is always defined.

  30 |
  31 |   // Only allow user to refetch every minute
> 32 |   if (cache.get('rate-limit', [email])) {
     |       ^
  33 |     return {
  34 |       error: true,
  35 |       message: 'Wait sometime before refetching',

so i added await in in src/actions/refresh-db/index.ts and it solved the issue, but i don't have much idea about it.

  if (await cache.get('rate-limit', [email])) {
    return {
      error: true,
      message: 'Wait sometime before refetching',
    };
  }

please check this.

Checklist before requesting a review

  • I have performed a self-review of my code
  • I assure there is no similar/duplicate pull request regarding same issue

@devsargam devsargam closed this Sep 24, 2024
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.

feature: Adding a next button for watching the next video in the thread.
2 participants