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

Use hooks for "create" tasks #550

Merged
merged 3 commits into from
Jan 9, 2023
Merged

Use hooks for "create" tasks #550

merged 3 commits into from
Jan 9, 2023

Conversation

AbdBarho
Copy link
Collaborator

@AbdBarho AbdBarho commented Jan 8, 2023

clean up code.

The same should be done for evaluate tasks.

@AbdBarho AbdBarho marked this pull request as ready for review January 8, 2023 18:09
@@ -26,10 +26,10 @@ export const useGenericTaskAPI = <TaskType,>(taskApiEndpoint: string) => {
);

useEffect(() => {
if (tasks.length === 0 && !isLoading && !error) {
if (data === undefined && !isLoading && !error) {
Copy link
Contributor

@Klotske Klotske Jan 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that change to undefined broke fix #393.
demo

Copy link
Collaborator Author

@AbdBarho AbdBarho Jan 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, how to reproduce?

EDIT: got iit

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed now, could you please check again?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. Fix is working!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. It's working 90% of the time. But when rapidly navigating it seems broken.
output3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should leave the check as it was? And wait for #551 to solve it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reduced the dedupe time to half a second, which should be reasonable.

#551 might solve this entirely, I don't know if we should squeeze it before MVP.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get the random task change done then we can switch to getServerSideProps. That can be rolled out anytime.

@fozziethebeat fozziethebeat merged commit 16df53f into main Jan 9, 2023
@fozziethebeat fozziethebeat deleted the use-hooks-create branch January 9, 2023 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants