Update URL normalization logic in App.tsx

This commit is contained in:
2026-02-01 05:10:40 +01:00
parent c9edc1e266
commit 9232054331

View File

@@ -287,10 +287,10 @@ export default function App() {
() => (markdownPreview ? markdownToHTML(body) : ""),
[body, markdownPreview]
);
const normalizedOllamaUrl = useMemo(
() => ollamaUrl.trim().replace(/\/+$/, ""),
[ollamaUrl]
);
const normalizedOllamaUrl = useMemo(() => {
const trimmed = ollamaUrl.trim();
return (trimmed || DEFAULT_OLLAMA_URL).replace(/\/+$/, "");
}, [ollamaUrl]);
const folderById = useMemo(() => {
const map = new Map<string, Folder>();