feat: add update polling to relevant views

This commit is contained in:
Jordan Knott
2020-12-23 15:55:17 -06:00
parent c4a80590a1
commit 0c9ab8abc2
7 changed files with 19 additions and 6 deletions

View File

@ -381,7 +381,11 @@ const Details: React.FC<DetailsProps> = ({
);
},
});
const { loading, data, refetch } = useFindTaskQuery({ variables: { taskID }, fetchPolicy: 'cache-and-network' });
const { loading, data, refetch } = useFindTaskQuery({
variables: { taskID },
pollInterval: 3000,
fetchPolicy: 'cache-and-network',
});
const [setTaskComplete] = useSetTaskCompleteMutation();
const [updateTaskDueDate] = useUpdateTaskDueDateMutation({
onCompleted: () => {

View File

@ -436,6 +436,7 @@ const Project = () => {
const { loading, data, error } = useFindProjectQuery({
variables: { projectID },
pollInterval: 3000,
});
const [updateProjectName] = useUpdateProjectNameMutation({

View File

@ -202,7 +202,7 @@ type ShowNewProject = {
const Projects = () => {
const { showPopup, hidePopup } = usePopup();
const { loading, data } = useGetProjectsQuery({ fetchPolicy: 'network-only' });
const { loading, data } = useGetProjectsQuery({ pollInterval: 3000, fetchPolicy: 'cache-and-network' });
useEffect(() => {
document.title = 'Taskcafé';
}, []);