- Simplified solution in previous commit
- Additional regression testing fixes Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -4,7 +4,7 @@ import { useMutation, useQuery } from "@apollo/client";
|
||||
import { MUTATION_TOGGLE_TASK_COMPLETED, MUTATION_TOGGLE_TASK_DELETED } from "../../graphql/tasks.queries.js";
|
||||
import { pageLimit } from "../../utils/config.js";
|
||||
import AlertComponent from "../alert/alert.component.jsx";
|
||||
import React, { useContext, useEffect } from "react";
|
||||
import React from "react";
|
||||
import TaskListComponent from "./task-list.component.jsx";
|
||||
import { notification } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -14,7 +14,6 @@ import AuditTrailMapping from "../../utils/AuditTrailMappings.js";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors.js";
|
||||
import dayjs from "../../utils/day";
|
||||
import { SharedModalContext } from "../../providers/shared-modal.provider.jsx";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -41,7 +40,6 @@ export function TaskListContainer({
|
||||
const searchParams = queryString.parse(useLocation().search);
|
||||
const { page, sortcolumn, sortorder, deleted, completed, mine } = searchParams;
|
||||
const dispatch = useDispatch();
|
||||
const { updateTaskQuery } = useContext(SharedModalContext); // Use the context
|
||||
|
||||
const { loading, error, data, refetch } = useQuery(query[Object.keys(query)[0]], {
|
||||
fetchPolicy: "network-only",
|
||||
@@ -166,11 +164,6 @@ export function TaskListContainer({
|
||||
}
|
||||
};
|
||||
|
||||
// Update the Last Task Paginated Query
|
||||
useEffect(() => {
|
||||
updateTaskQuery(Object.keys(query)[0]);
|
||||
}, [query]);
|
||||
|
||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user