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

Update all the task pages to fetch a new taks after submission #192

Merged
merged 1 commit into from Dec 31, 2022

Conversation

fozziethebeat
Copy link
Collaborator

Closes #104

When a user submits an answer to a task and gets to the done state we reveal a Next Task button that will fetch a new task for them to work on in the same type.

This leverages useSWR's mutate function to refetch tasks.

@@ -52,6 +56,7 @@ const AssistantReply = () => {
}

const task = tasks[0].task;
const endTask = tasks[tasks.length - 1];
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is the advantage of having an array of tasks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was originally based on how the demo text-frontend handled tasks. After submitting the prototype was returning a potentially different task.

Now that it's changed to always return task_done after submission, I want to simplify all this in another PR that reduces code duplication.

@fozziethebeat fozziethebeat merged commit 9b5a220 into main Dec 31, 2022
@fozziethebeat fozziethebeat deleted the 104-load-new-tasks branch December 31, 2022 09:37
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.

Load a new task for users when reaching the done state
2 participants