-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Save the code and add checkpoint so the users can start from where they left off #102
base: main
Are you sure you want to change the base?
Conversation
import { getCheckPoint } from '@/lib/progressSaving' | ||
|
||
|
||
export default function CheckpointRedirect() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as in the previous PR: is there any reason to implement the redirect in a component, instead of a plan function?
I can't see much reason for using useEffect() here - @JeelRajodiya can you please advise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if there is any other way to redirect without useEffect in this case.
I think @pavanydg has separated the code in a component because it requires the client side hook useEffect(), while our home page is a server side component. (When to use Server and Client Components?)
@@ -85,7 +98,9 @@ export default function CodeEditor({ | |||
theme={colorMode === "light" ? "light" : "my-theme"} | |||
value={codeString} | |||
height={"100%"} | |||
onChange={(codeString) => setCodeString(codeString ? codeString : "")} | |||
onChange={(codeString) => | |||
setCodeString(codeString ? codeString : "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use either ||
or ??
operator here?
@@ -83,6 +85,7 @@ export default function NavBarMenu() { | |||
duration: 3000, | |||
isClosable: true, | |||
}); | |||
window.location.reload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please avoid reloading the whole window?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { getCheckPoint } from '@/lib/progressSaving' | ||
|
||
|
||
export default function CheckpointRedirect() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if there is any other way to redirect without useEffect in this case.
I think @pavanydg has separated the code in a component because it requires the client side hook useEffect(), while our home page is a server side component. (When to use Server and Client Components?)
@pavanydg Great work! the feature is working as expected, we just need some refactoring in the code. Please see my comment above. |
What kind of change does this PR introduce?
Saves the code of each lesson if user has written any code in it.
Also adds a checkpoint from where users can resume their learning when open the website again.
Issue Number:
Screenshots/videos:
Screencast.from.10-17-2024.11.25.16.PM.webm
If relevant, did you update the documentation?
Summary
Does this PR introduce a breaking change?