refactor: polling is now turned off in development mode
This commit is contained in:
@ -36,6 +36,7 @@ import Input from 'shared/components/Input';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import updateApolloCache from 'shared/utils/cache';
|
||||
import NOOP from 'shared/utils/noop';
|
||||
import polling from 'shared/utils/polling';
|
||||
|
||||
export const ActionsList = styled.ul`
|
||||
margin: 0;
|
||||
@ -384,7 +385,7 @@ const Details: React.FC<DetailsProps> = ({
|
||||
});
|
||||
const { loading, data, refetch } = useFindTaskQuery({
|
||||
variables: { taskID },
|
||||
pollInterval: 3000,
|
||||
pollInterval: polling.TASK_DETAILS,
|
||||
fetchPolicy: 'cache-and-network',
|
||||
});
|
||||
const [setTaskComplete] = useSetTaskCompleteMutation();
|
||||
|
@ -35,6 +35,7 @@ import Board, { BoardLoading } from './Board';
|
||||
import Details from './Details';
|
||||
import LabelManagerEditor from './LabelManagerEditor';
|
||||
import UserManagementPopup from './UserManagementPopup';
|
||||
import polling from 'shared/utils/polling';
|
||||
|
||||
type TaskRouteProps = {
|
||||
taskID: string;
|
||||
@ -60,7 +61,7 @@ const Project = () => {
|
||||
const [updateTaskName] = useUpdateTaskNameMutation();
|
||||
const { data, error } = useFindProjectQuery({
|
||||
variables: { projectID },
|
||||
pollInterval: 3000,
|
||||
pollInterval: polling.PROJECT,
|
||||
});
|
||||
const [toggleTaskLabel] = useToggleTaskLabelMutation({
|
||||
onCompleted: newTaskLabel => {
|
||||
|
@ -22,6 +22,7 @@ import produce from 'immer';
|
||||
import NOOP from 'shared/utils/noop';
|
||||
import theme from 'App/ThemeStyles';
|
||||
import { mixin } from '../shared/utils/styles';
|
||||
import polling from 'shared/utils/polling';
|
||||
|
||||
type CreateTeamData = { teamName: string };
|
||||
|
||||
@ -203,7 +204,7 @@ type ShowNewProject = {
|
||||
|
||||
const Projects = () => {
|
||||
const { showPopup, hidePopup } = usePopup();
|
||||
const { loading, data } = useGetProjectsQuery({ pollInterval: 3000, fetchPolicy: 'cache-and-network' });
|
||||
const { loading, data } = useGetProjectsQuery({ pollInterval: polling.PROJECTS, fetchPolicy: 'cache-and-network' });
|
||||
useEffect(() => {
|
||||
document.title = 'Taskcafé';
|
||||
}, []);
|
||||
|
Reference in New Issue
Block a user