diff --git a/frontend/src/api/teams.ts b/frontend/src/api/teams.ts
index e17ee39b7d..4f337d63f7 100644
--- a/frontend/src/api/teams.ts
+++ b/frontend/src/api/teams.ts
@@ -1,8 +1,7 @@
import { useSelector } from 'react-redux';
import { useQuery } from '@tanstack/react-query';
-
import api from './apiClient';
-import { RootStore } from '../store';
+import type { RootStore } from '../store';
export const useTeamsQuery = (params: any, otherOptions: any) => {
const token = useSelector((state: RootStore) => state.auth.token);
diff --git a/frontend/src/components/projects/downloadAsCSV.jsx b/frontend/src/components/projects/downloadAsCSV.jsx
index 66bed73516..91020521cf 100644
--- a/frontend/src/components/projects/downloadAsCSV.jsx
+++ b/frontend/src/components/projects/downloadAsCSV.jsx
@@ -76,5 +76,5 @@ export default function DownloadAsCSV({ allQueryParams }) {
}
DownloadAsCSV.propTypes = {
- allQueryParams: PropTypes.string.isRequired,
+ allQueryParams: PropTypes.object.isRequired,
};
diff --git a/frontend/src/components/taskSelection/index.tsx b/frontend/src/components/taskSelection/index.tsx
index 051c6c67db..0fdc85d108 100644
--- a/frontend/src/components/taskSelection/index.tsx
+++ b/frontend/src/components/taskSelection/index.tsx
@@ -81,7 +81,7 @@ export function TaskSelection({
const { data: userTeams, isLoading: isUserTeamsLoading } = useTeamsQuery(
{
omitMemberList: true,
- member: user.id,
+ member: user?.id,
},
{
useErrorBoundary: true,
@@ -158,23 +158,23 @@ export function TaskSelection({
// do not redirect if user is not from project detail page
if (location?.state?.from !== `/projects/${projectId}`) return;
if (contributions && isFirstRender.current) {
- const currentUserContributions = contributions.filter((u) => u.username === user.username);
- if (textSearch || (user.isExpert && currentUserContributions.length > 0)) {
+ const currentUserContributions = contributions.filter((u) => u.username === user?.username);
+ if (textSearch || (user?.isExpert && currentUserContributions.length > 0)) {
setActiveSection('tasks');
} else {
setActiveSection('instructions');
}
isFirstRender.current = false;
}
- }, [contributions, user.username, user, textSearch, setActiveSection, location, projectId]);
+ }, [contributions, user?.username, user, textSearch, setActiveSection, location, projectId]);
useEffect(() => {
// run it only when the component is initialized
// it checks if the user has tasks locked on the project and suggests to resume them
- if (!mapInit && activities && activities.activity && user.username && !isUserTeamsLoading) {
+ if (!mapInit && activities && activities.activity && user?.username && !isUserTeamsLoading) {
const lockedByCurrentUser = activities.activity
.filter((i) => i.taskStatus.startsWith('LOCKED_FOR_'))
- .filter((i) => i.actionBy === user.username);
+ .filter((i) => i.actionBy === user?.username);
if (lockedByCurrentUser.length) {
const userLockedTasks = lockedByCurrentUser.map((i) => i.taskId);
setSelectedTasks(userLockedTasks);
@@ -287,7 +287,7 @@ export function TaskSelection({
{(close) => (