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(web-app): repair the type error breaking every build on this branch (#8570)

Thinh Lea103c678f4e5
diff --git a/web-app/src/containers/ChatInput.tsx b/web-app/src/containers/ChatInput.tsx
index c7aad4d0d..99f95e125 100644
--- a/web-app/src/containers/ChatInput.tsx
+++ b/web-app/src/containers/ChatInput.tsx
@@ -101,11 +101,9 @@ import JanBrowserExtensionDialog from '@/containers/dialogs/JanBrowserExtensionD
import { useJanBrowserExtension } from '@/hooks/useJanBrowserExtension'
import { useAgentMode } from '@/hooks/useAgentMode'
import { useWebSearchConfig } from '@/hooks/useWebSearchConfig'
-import { usePathReferences } from '@/stores/path-references'
import {
parsePromptForReferences,
resolvePathReference,
- formatPathReferenceText,
searchFiles,
REFERENCE_PATTERN,
type FilePickerEntry as FileEntry,
@@ -197,11 +195,6 @@ const ChatInput = memo(function ChatInput({
const webSearchEnabled = useWebSearchConfig((s) => s.webSearchEnabled)
const setWebSearchEnabled = useWebSearchConfig((s) => s.setWebSearchEnabled)
- // ── @path file reference state ──────────────────────────────────────────
- const pathRefs = usePathReferences((s) => s.references)
- const setPathRefs = usePathReferences((s) => s.setReferences)
- const clearPathRefs = usePathReferences((s) => s.clearReferences)
-
const [filePickerOpen, setFilePickerOpen] = useState(false)
const [filePickerQuery, setFilePickerQuery] = useState('')
const [filePickerEntries, setFilePickerEntries] = useState<FileEntry[]>([])
@@ -218,7 +211,7 @@ const ChatInput = memo(function ChatInput({
const loadWorkingDir = async () => {
try {
// Try to get project home directory
- const { homeDir, documentDir } = await import('@tauri-apps/api/path')
+ const { homeDir } = await import('@tauri-apps/api/path')
const home = await homeDir()
setWorkingDir(home)
} catch {
@@ -330,7 +323,7 @@ const ChatInput = memo(function ChatInput({
}
} else {
parts.push(
- `[File not found or too large: ${ref.rawPath}]`
+ `[File not found or too large: ${ref}]`
)
}
}
diff --git a/web-app/src/lib/path-references.ts b/web-app/src/lib/path-references.ts
index 35ae2850d..2e6f62f35 100644
--- a/web-app/src/lib/path-references.ts
+++ b/web-app/src/lib/path-references.ts
@@ -9,7 +9,7 @@
* as inline notices.
*/
import { fs } from '@janhq/core'
-import type { PathReference, FilePickerEntry } from '@/types/path-reference'
+import type { FilePickerEntry } from '@/types/path-reference'
export type { FilePickerEntry }