feat: add update polling to relevant views
This commit is contained in:
parent
c4a80590a1
commit
0c9ab8abc2
@ -174,7 +174,7 @@ const AdminRoute = () => {
|
||||
useEffect(() => {
|
||||
document.title = 'Admin | Taskcafé';
|
||||
}, []);
|
||||
const { loading, data } = useUsersQuery();
|
||||
const { loading, data } = useUsersQuery({ fetchPolicy: 'cache-and-network' });
|
||||
const { showPopup, hidePopup } = usePopup();
|
||||
const { user } = useCurrentUser();
|
||||
const [deleteInvitedUser] = useDeleteInvitedUserAccountMutation({
|
||||
|
@ -128,7 +128,7 @@ const TeamProjectContainer = styled.div`
|
||||
const colors = [theme.colors.primary, theme.colors.secondary];
|
||||
|
||||
const ProjectFinder = () => {
|
||||
const { loading, data } = useGetProjectsQuery();
|
||||
const { loading, data } = useGetProjectsQuery({ fetchPolicy: 'cache-and-network' });
|
||||
if (loading) {
|
||||
return <span>loading</span>;
|
||||
}
|
||||
|
@ -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: () => {
|
||||
|
@ -436,6 +436,7 @@ const Project = () => {
|
||||
|
||||
const { loading, data, error } = useFindProjectQuery({
|
||||
variables: { projectID },
|
||||
pollInterval: 3000,
|
||||
});
|
||||
|
||||
const [updateProjectName] = useUpdateProjectNameMutation({
|
||||
|
@ -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é';
|
||||
}, []);
|
||||
|
@ -419,7 +419,11 @@ type MembersProps = {
|
||||
|
||||
const Members: React.FC<MembersProps> = ({ teamID }) => {
|
||||
const { showPopup, hidePopup } = usePopup();
|
||||
const { loading, data } = useGetTeamQuery({ variables: { teamID } });
|
||||
const { loading, data } = useGetTeamQuery({
|
||||
variables: { teamID },
|
||||
fetchPolicy: 'cache-and-network',
|
||||
pollInterval: 3000,
|
||||
});
|
||||
const { user, setUserRoles } = useCurrentUser();
|
||||
const warning =
|
||||
'You can’t leave because you are the only admin. To make another user an admin, click their avatar, select “Change permissions…”, and select “Admin”.';
|
||||
|
@ -155,7 +155,11 @@ type TeamProjectsProps = {
|
||||
};
|
||||
|
||||
const TeamProjects: React.FC<TeamProjectsProps> = ({ teamID }) => {
|
||||
const { loading, data } = useGetTeamQuery({ variables: { teamID } });
|
||||
const { loading, data } = useGetTeamQuery({
|
||||
variables: { teamID },
|
||||
fetchPolicy: 'cache-and-network',
|
||||
pollInterval: 3000,
|
||||
});
|
||||
if (loading) {
|
||||
return <span>loading</span>;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user