Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: fix linter with missing parameters

Vanalite43ae944958d9
diff --git a/web-app/src/containers/DownloadButton.tsx b/web-app/src/containers/DownloadButton.tsx
index 8acc92af3..c051f5d0c 100644
--- a/web-app/src/containers/DownloadButton.tsx
+++ b/web-app/src/containers/DownloadButton.tsx
@@ -75,7 +75,7 @@ export function DownloadButtonPlaceholder({
if (state.modelId === modelId) setDownloaded(true)
}
)
- }, [])
+ }, [modelId])
const isRecommendedModel = useCallback((modelId: string) => {
return (extractModelName(modelId)?.toLowerCase() ===
diff --git a/web-app/src/containers/ThreadScrollBehaviorSwitcher.tsx b/web-app/src/containers/ThreadScrollBehaviorSwitcher.tsx
index f322c7773..c6c1fb817 100644
--- a/web-app/src/containers/ThreadScrollBehaviorSwitcher.tsx
+++ b/web-app/src/containers/ThreadScrollBehaviorSwitcher.tsx
@@ -438,7 +438,7 @@ function StickyScrollPreview({ placeholder }: { placeholder: string }) {
timersRef.current.push(timer)
})
}
- }, [step])
+ }, [step, MAX_ASSISTANTS])
useEffect(() => {
return () => {
diff --git a/web-app/src/hooks/useChat.ts b/web-app/src/hooks/useChat.ts
index a2efc9b91..a3fca8501 100644
--- a/web-app/src/hooks/useChat.ts
+++ b/web-app/src/hooks/useChat.ts
@@ -377,7 +377,7 @@ export const useChat = () => {
.getActiveModels()
.then((models) => setActiveModels(models || []))
},
- [updateLoadingModel, serviceHub]
+ [updateLoadingModel, serviceHub, setActiveModels]
)
const increaseModelContextSize = useCallback(
diff --git a/web-app/src/hooks/useThreadScrolling.tsx b/web-app/src/hooks/useThreadScrolling.tsx
index 8ebd0e64b..783bdd2f0 100644
--- a/web-app/src/hooks/useThreadScrolling.tsx
+++ b/web-app/src/hooks/useThreadScrolling.tsx
@@ -149,7 +149,7 @@ export const useThreadScrolling = (
return () =>
scrollContainer.removeEventListener('scroll', handleScroll)
}
- }, [handleScroll])
+ }, [handleScroll, scrollContainerRef])
const checkScrollState = useCallback(() => {
const scrollContainer = scrollContainerRef.current
@@ -161,7 +161,7 @@ export const useThreadScrolling = (
setIsAtBottom(isBottom)
setHasScrollbar(hasScroll)
- }, [])
+ }, [scrollContainerRef])
useEffect(() => {
if (!scrollContainerRef.current) return
@@ -172,7 +172,7 @@ export const useThreadScrolling = (
scrollToBottom(false)
checkScrollState()
}
- }, [checkScrollState, scrollToBottom])
+ }, [checkScrollState, scrollToBottom, scrollContainerRef])
const prevCountRef = useRef(messageCount)
useEffect(() => {
@@ -220,7 +220,7 @@ export const useThreadScrolling = (
}
prevCountRef.current = messageCount
- }, [isFlowScroll, lastMessageRole, messageCount])
+ }, [isFlowScroll, lastMessageRole, messageCount, getDOMElements, setPaddingHeight])
useEffect(() => {
const previouslyStreaming = wasStreamingRef.current
@@ -276,13 +276,13 @@ export const useThreadScrolling = (
}
wasStreamingRef.current = currentlyStreaming
- }, [getDOMElements, isFlowScroll, streamingContent, threadId])
+ }, [getDOMElements, isFlowScroll, streamingContent, threadId, setPaddingHeight])
useEffect(() => {
if (isFlowScroll) return
setPaddingHeight(0)
originalPaddingRef.current = 0
- }, [isFlowScroll])
+ }, [isFlowScroll, setPaddingHeight])
useEffect(() => {
if (!isStickyScroll) {