Skip to content

Instantly share code, notes, and snippets.

@iddar
Created June 9, 2021 17:27
Show Gist options
  • Save iddar/5629a563a073ef28f26571b2c62cb420 to your computer and use it in GitHub Desktop.
Save iddar/5629a563a073ef28f26571b2c62cb420 to your computer and use it in GitHub Desktop.
const getNextVideo = () => {
setNextLoading(true)
for (let i = 0; i < lessons.length; i++) {
WatchedLessons.WatchedVideo(lessons[i].doc ?? '', user?.uid).then(res => {
if (res) {
setNext(lessons[i + 1])
}
})
setNextLoading(false)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment