Skip to content

Commit

Permalink
chore: remove console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeSlain committed Nov 26, 2024
1 parent 85121c0 commit b6d9639
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 26 deletions.
1 change: 0 additions & 1 deletion src/api/useGetMfsOrganizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ const fetchOrganizations = async (): Promise<string[]> => {
throw new Error('Impossible de récupérer les maisons france service', { cause: res })
}
const institutions = await res.json()
console.log(institutions)
return institutions as string[]
}
3 changes: 0 additions & 3 deletions src/components/Auth/LoginFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ function MFSInput({ selectedValue, setSelectedValue, matricule, setMatricule })
})

if (!response.ok) {
// Handle HTTP errors
const errorText = await response.text()
throw new Error(`Error ${response.status}: ${errorText}`)
}
Expand All @@ -136,13 +135,11 @@ function MFSInput({ selectedValue, setSelectedValue, matricule, setMatricule })
setData(institutions)
} catch (error) {
console.error('Failed to fetch MFS organizations:', error)
// Optionally, set an error state here to display to the user
}
}

fetchData()
}, [])
console.log('data', data)
const fuse = useMemo(
() =>
new Fuse(data, {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Meeting/MeetingCurrentResponse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export const MeetingCurrentResponse = function MeetingCurrentResponse({
const { history, chatId, lastStreamId, messages, question } = useSelector(
selectMeetingCurrentResponse,
)
// useEffect(() => {
// console.log('rendered')
// },[])

const ref = useRef<HTMLDivElement>(null)

useEffect(() => {
Expand Down
6 changes: 1 addition & 5 deletions src/components/Meeting/MeetingFirstQuestionSidePanel.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import type { MeetingInputContext, RootState } from '@types'
import type { MeetingInputContext } from '@types'
import { GlobalColContainer } from 'components/Global/GlobalColContainer'
import { OneThirdScreenWidth } from 'components/Global/OneThirdScreenWidth'
import { useEffect } from 'react'
import { useSelector } from 'react-redux'

export function FirstQuestionExample({
setQuestionInput,
}: { setQuestionInput: (question: string) => void }) {
// useEffect(() => {
// console.log('rendered')
// }, [])
return (
<div className="fr-mb-2w">
<h6 style={{ lineHeight: 1 }} className="fr-mb-3v">
Expand Down
4 changes: 1 addition & 3 deletions src/components/Meeting/MeetingOutputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ export const MeetingOutputs = memo(function MeetingOutputs({
administrations: [],
themes: [],
})
// useEffect(() => {
// console.log('rendered', context)
// },[])

useEffect(() => {
if (chatId !== undefined && archiveData && archiveData.length > 0) {
if (Array.isArray(archiveData)) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const Root = () => {
checkConnexion(setUserAuth, userUrl).finally(() => setIsLoading(false))
}, [dispatch])
if (isLoading) {
return <div></div>
return null
}

return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function ChatList() {
}, [inView, hasNextPage, fetchNextPage])

if (error) {
console.log(error)
console.error(error)
return <ShowError message={error.message} errorNumber={error.status} />
}

Expand Down Expand Up @@ -108,7 +108,7 @@ function QuestionsSidePanel({ selectedChatId }: { selectedChatId: number }) {
function QuestionList({ selectedChatId }) {
const { data: archive, error } = useGetChatArchiveById(selectedChatId)
if (error) {
console.log(error)
console.error(error)
}

if (!archive || !archive.streams) {
Expand Down
8 changes: 1 addition & 7 deletions src/pages/Signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { userUrl } from '@api'
import { ButtonsGroup } from '@codegouvfr/react-dsfr/ButtonsGroup'
import { initButtonsSignup } from '@constants/connexion'
import { signupFields } from '@constants/inputFields'
import { useGetOrganizations } from 'api/useGetMfsOrganizations'
import { useEffect, useState } from 'react'
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import {
email,
Expand Down Expand Up @@ -45,10 +44,6 @@ export function Signup({ authFailed, setAuthFailed, userAuth, setUserAuth }) {
const [selectedMatricule, setSelectedMatricule] = useState('')
const [sent, setSent] = useState(false)

const { data: organizations, error } = useGetOrganizations()
useEffect(() => {
if (organizations) console.log(organizations)
}, [organizations])
const navigate = useNavigate()
const handleChange = (e) => {
e.preventDefault()
Expand Down Expand Up @@ -190,7 +185,6 @@ const useFetch = async (url, method, props) => {
})

if (!response.ok) {
// Parsing the response body to access detailed information
const errorDetails = await response.json()
return {
success: false,
Expand Down
1 change: 0 additions & 1 deletion src/utils/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ function handleStreamMessage(e, dispatch, stream_chat, id: number) {
dispatch({ type: 'SET_STREAM_ID', nextStreamId: 0 })
return dispatch({ type: 'STOP_AGENT_STREAM' })
}
//console.log(jsonData.choices[0].delta.content)
return dispatch({
type: 'GET_AGENT_STREAM',
nextResponse: jsonData.choices[0].delta.content
Expand Down

0 comments on commit b6d9639

Please sign in to comment.