Merge pull request #2 from langflow-ai/copilot/fix-d8e1025c-8448-4a81-92b1-e3be20f19b18
Fix ESLint errors: remove unused variable and add missing dependencies
This commit is contained in:
commit
876c53e584
2 changed files with 7 additions and 7 deletions
|
|
@ -70,7 +70,7 @@ interface RequestBody {
|
||||||
function ChatPage() {
|
function ChatPage() {
|
||||||
const isDebugMode = process.env.NODE_ENV === 'development' || process.env.NEXT_PUBLIC_OPENRAG_DEBUG === 'true'
|
const isDebugMode = process.env.NODE_ENV === 'development' || process.env.NEXT_PUBLIC_OPENRAG_DEBUG === 'true'
|
||||||
const { user } = useAuth()
|
const { user } = useAuth()
|
||||||
const { endpoint, setEndpoint, currentConversationId, conversationData, setCurrentConversationId, addConversationDoc, forkFromResponse, refreshConversations, previousResponseIds, setPreviousResponseIds, setPlaceholderConversation } = useChat()
|
const { endpoint, setEndpoint, currentConversationId, conversationData, setCurrentConversationId, addConversationDoc, forkFromResponse, refreshConversations, previousResponseIds, setPreviousResponseIds } = useChat()
|
||||||
const [messages, setMessages] = useState<Message[]>([
|
const [messages, setMessages] = useState<Message[]>([
|
||||||
{
|
{
|
||||||
role: "assistant",
|
role: "assistant",
|
||||||
|
|
@ -436,7 +436,7 @@ function ChatPage() {
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
}, [conversationData, currentConversationId, isUserInteracting, isForkingInProgress, lastForkTimestamp])
|
}, [conversationData, currentConversationId, isUserInteracting, isForkingInProgress, lastForkTimestamp, setPreviousResponseIds])
|
||||||
|
|
||||||
// Listen for file upload events from navigation
|
// Listen for file upload events from navigation
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -508,7 +508,7 @@ function ChatPage() {
|
||||||
window.removeEventListener('fileUploadComplete', handleFileUploadComplete as EventListener)
|
window.removeEventListener('fileUploadComplete', handleFileUploadComplete as EventListener)
|
||||||
window.removeEventListener('fileUploadError', handleFileUploadError as EventListener)
|
window.removeEventListener('fileUploadError', handleFileUploadError as EventListener)
|
||||||
}
|
}
|
||||||
}, [endpoint])
|
}, [endpoint, setPreviousResponseIds])
|
||||||
|
|
||||||
// Handle click outside to close dropdown
|
// Handle click outside to close dropdown
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import React, { createContext, useContext, useState, useEffect, ReactNode } from 'react'
|
import React, { createContext, useContext, useState, useEffect, useCallback, ReactNode } from 'react'
|
||||||
|
|
||||||
interface User {
|
interface User {
|
||||||
user_id: string
|
user_id: string
|
||||||
|
|
@ -40,7 +40,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
|
||||||
const [isLoading, setIsLoading] = useState(true)
|
const [isLoading, setIsLoading] = useState(true)
|
||||||
const [isNoAuthMode, setIsNoAuthMode] = useState(false)
|
const [isNoAuthMode, setIsNoAuthMode] = useState(false)
|
||||||
|
|
||||||
const checkAuth = async () => {
|
const checkAuth = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/auth/me')
|
const response = await fetch('/api/auth/me')
|
||||||
|
|
||||||
|
|
@ -72,7 +72,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
|
||||||
console.log('Backend not ready, retrying in 2 seconds...')
|
console.log('Backend not ready, retrying in 2 seconds...')
|
||||||
setTimeout(checkAuth, 2000)
|
setTimeout(checkAuth, 2000)
|
||||||
}
|
}
|
||||||
}
|
}, [])
|
||||||
|
|
||||||
const login = () => {
|
const login = () => {
|
||||||
// Don't allow login in no-auth mode
|
// Don't allow login in no-auth mode
|
||||||
|
|
@ -157,7 +157,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
checkAuth()
|
checkAuth()
|
||||||
}, [])
|
}, [checkAuth])
|
||||||
|
|
||||||
const value: AuthContextType = {
|
const value: AuthContextType = {
|
||||||
user,
|
user,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue