mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 20:24:32 +02:00
@@ -534,7 +534,7 @@ export function ChatInputBar({
|
||||
filterManager.selectedDocumentSets.length > 0 ||
|
||||
filterManager.selectedTags.length > 0 ||
|
||||
filterManager.selectedSources.length > 0) && (
|
||||
<div className="flex gap-x-.5 px-2">
|
||||
<div className="flex bg-background gap-x-.5 px-2">
|
||||
<div className="flex gap-x-1 px-2 overflow-visible overflow-x-scroll items-end miniscroll">
|
||||
{filterManager.selectedTags &&
|
||||
filterManager.selectedTags.map((tag, index) => (
|
||||
|
@@ -21,8 +21,12 @@ export const AddMemberForm: React.FC<AddMemberFormProps> = ({
|
||||
const [selectedUserIds, setSelectedUserIds] = useState<string[]>([]);
|
||||
|
||||
return (
|
||||
<Modal title="Add New User" onOutsideClick={() => onClose()}>
|
||||
<div className="px-6 pt-4 pb-12">
|
||||
<Modal
|
||||
className="max-w-xl"
|
||||
title="Add New User"
|
||||
onOutsideClick={() => onClose()}
|
||||
>
|
||||
<div className="flex flex-col">
|
||||
<UserEditor
|
||||
selectedUserIds={selectedUserIds}
|
||||
setSelectedUserIds={setSelectedUserIds}
|
||||
|
@@ -120,9 +120,7 @@ export function Modal({
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex-grow overflow-y-auto overflow-x-hidden">
|
||||
{children}
|
||||
</div>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@@ -160,7 +160,7 @@ export function UserDropdown({
|
||||
{user && user.email ? user.email[0].toUpperCase() : "A"}
|
||||
</div>
|
||||
{notifications && notifications.length > 0 && (
|
||||
<div className="absolute right-0 top-0 w-3 h-3 bg-red-500 rounded-full"></div>
|
||||
<div className="absolute -right-0.5 -top-0.5 w-3 h-3 bg-red-500 rounded-full"></div>
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
|
@@ -11,6 +11,8 @@ import {
|
||||
import { ChatSession, InputPrompt } from "@/app/chat/interfaces";
|
||||
import { LLMProviderDescriptor } from "@/app/admin/configuration/llm/interfaces";
|
||||
import { Folder } from "@/app/chat/folders/interfaces";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
interface ChatContextProps {
|
||||
chatSessions: ChatSession[];
|
||||
@@ -49,6 +51,8 @@ export const ChatProvider: React.FC<{
|
||||
>;
|
||||
children: React.ReactNode;
|
||||
}> = ({ value, children }) => {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const [inputPrompts, setInputPrompts] = useState(value?.inputPrompts || []);
|
||||
const [chatSessions, setChatSessions] = useState(value?.chatSessions || []);
|
||||
const [folders, setFolders] = useState(value?.folders || []);
|
||||
@@ -70,6 +74,16 @@ export const ChatProvider: React.FC<{
|
||||
if (!response.ok) throw new Error("Failed to fetch chat sessions");
|
||||
const { sessions } = await response.json();
|
||||
setChatSessions(sessions);
|
||||
|
||||
const currentSessionId = searchParams.get("chatId");
|
||||
if (
|
||||
currentSessionId &&
|
||||
!sessions.some(
|
||||
(session: ChatSession) => session.id === currentSessionId
|
||||
)
|
||||
) {
|
||||
router.replace("/chat");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error refreshing chat sessions:", error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user