diff --git a/frontend/src/Admin/index.tsx b/frontend/src/Admin/index.tsx index 5debe10b..402d8ce3 100644 --- a/frontend/src/Admin/index.tsx +++ b/frontend/src/Admin/index.tsx @@ -214,9 +214,6 @@ const AdminRoute = () => { }); }, }); - if (loading) { - return ; - } if (data && user) { if (user.roles.org !== 'admin') { return ; @@ -259,7 +256,7 @@ const AdminRoute = () => { ); } - return error; + return ; }; export default AdminRoute; diff --git a/frontend/src/App/TopNavbar.tsx b/frontend/src/App/TopNavbar.tsx index 7ba409a2..4186c537 100644 --- a/frontend/src/App/TopNavbar.tsx +++ b/frontend/src/App/TopNavbar.tsx @@ -129,9 +129,6 @@ const colors = [theme.colors.primary, theme.colors.secondary]; const ProjectFinder = () => { const { loading, data } = useGetProjectsQuery({ fetchPolicy: 'cache-and-network' }); - if (loading) { - return loading; - } if (data) { const { projects, teams } = data; const personalProjects = data.projects.filter(p => p.team === null); @@ -181,7 +178,7 @@ const ProjectFinder = () => { ); } - return error; + return loading; }; type ProjectPopupProps = { history: any; diff --git a/frontend/src/Projects/Project/Board/index.tsx b/frontend/src/Projects/Project/Board/index.tsx index 686ab9a7..83cba6f5 100644 --- a/frontend/src/Projects/Project/Board/index.tsx +++ b/frontend/src/Projects/Project/Board/index.tsx @@ -459,9 +459,6 @@ const ProjectBoard: React.FC = ({ projectID, onCardLabelClick } }; - if (loading) { - return ; - } const getTaskStatusFilterLabel = (filter: TaskStatusFilter) => { if (filter.status === TaskStatus.COMPLETE) { return 'Complete'; @@ -818,7 +815,7 @@ const ProjectBoard: React.FC = ({ projectID, onCardLabelClick ); } - return Error; + return ; }; export default ProjectBoard; diff --git a/frontend/src/Projects/Project/index.tsx b/frontend/src/Projects/Project/index.tsx index b7ef3710..2e5d712a 100644 --- a/frontend/src/Projects/Project/index.tsx +++ b/frontend/src/Projects/Project/index.tsx @@ -517,14 +517,6 @@ const Project = () => { document.title = `${data.findProject.name} | Taskcafé`; } }, [data]); - if (loading) { - return ( - <> - - - - ); - } if (error) { history.push('/projects'); } @@ -637,7 +629,12 @@ const Project = () => { ); } - return
Error
; + return ( + <> + + + + ); }; export default Project; diff --git a/frontend/src/Projects/index.tsx b/frontend/src/Projects/index.tsx index 159db44d..1ee15aef 100644 --- a/frontend/src/Projects/index.tsx +++ b/frontend/src/Projects/index.tsx @@ -231,9 +231,6 @@ const Projects = () => { ); }, }); - if (loading) { - return ; - } const colors = theme.colors.multiColors; if (data && user) { @@ -395,7 +392,7 @@ const Projects = () => { ); } - return
Error!
; + return ; }; export default Projects; diff --git a/frontend/src/Teams/Members/index.tsx b/frontend/src/Teams/Members/index.tsx index f69abb06..b9fb9407 100644 --- a/frontend/src/Teams/Members/index.tsx +++ b/frontend/src/Teams/Members/index.tsx @@ -472,9 +472,6 @@ const Members: React.FC = ({ teamID }) => { ); }, }); - if (loading) { - return loading; - } if (data && user) { return ( @@ -562,7 +559,7 @@ const Members: React.FC = ({ teamID }) => { ); } - return
error
; + return
loading
; }; export default Members; diff --git a/frontend/src/Teams/Projects/index.tsx b/frontend/src/Teams/Projects/index.tsx index b2f9c77d..48491b53 100644 --- a/frontend/src/Teams/Projects/index.tsx +++ b/frontend/src/Teams/Projects/index.tsx @@ -160,9 +160,6 @@ const TeamProjects: React.FC = ({ teamID }) => { fetchPolicy: 'cache-and-network', pollInterval: 3000, }); - if (loading) { - return loading; - } if (data) { return ( @@ -193,7 +190,7 @@ const TeamProjects: React.FC = ({ teamID }) => { ); } - return error; + return loading; }; export default TeamProjects; diff --git a/frontend/src/Teams/index.tsx b/frontend/src/Teams/index.tsx index 843ff499..b9b3dbb0 100644 --- a/frontend/src/Teams/index.tsx +++ b/frontend/src/Teams/index.tsx @@ -94,23 +94,6 @@ const Teams = () => { const { user } = useCurrentUser(); const [currentTab, setCurrentTab] = useState(0); const match = useRouteMatch(); - if (loading) { - return ( - { - setCurrentTab(tab); - }} - onSaveProjectName={NOOP} - projectID={null} - name={null} - /> - ); - } if (data && user) { if (!user.isVisible(PermissionLevel.TEAM, PermissionObjectType.TEAM, teamID)) { return ; @@ -146,7 +129,21 @@ const Teams = () => { ); } - return
Error!
; + return ( + { + setCurrentTab(tab); + }} + onSaveProjectName={NOOP} + projectID={null} + name={null} + /> + ); }; export default Teams;