Always pull latest data when visiting main search page

This commit is contained in:
Weves 2023-12-03 03:20:58 -08:00 committed by Chris Weaver
parent ac35719038
commit 292c78b193
4 changed files with 16 additions and 11 deletions

View File

@ -1,13 +1,10 @@
import { ErrorCallout } from "@/components/ErrorCallout";
import { fetchSS } from "@/lib/utilsSS";
import { FaRobot } from "react-icons/fa";
import { Persona } from "../interfaces";
import { PersonaEditor } from "../PersonaEditor";
import { DocumentSet } from "@/lib/types";
import { RobotIcon } from "@/components/icons/icons";
import { BackButton } from "@/components/BackButton";
import { Card, Title, Text, Divider, Button } from "@tremor/react";
import { FiTrash } from "react-icons/fi";
import { Card, Title } from "@tremor/react";
import { DeletePersonaButton } from "./DeletePersonaButton";
export default async function Page({

View File

@ -10,8 +10,14 @@ import { cookies } from "next/headers";
import { SearchType } from "@/lib/search/interfaces";
import { Persona } from "./admin/personas/interfaces";
import { WelcomeModal } from "@/components/WelcomeModal";
import { unstable_noStore as noStore } from "next/cache";
export default async function Home() {
// Disable caching so we always get the up to date connector / document set / persona info
// importantly, this prevents users from adding a connector, going back to the main page,
// and then getting hit with a "No Connectors" popup
noStore();
const tasks = [
getAuthDisabledSS(),
getCurrentUserSS(),

View File

@ -2,9 +2,15 @@ interface ModalProps {
children: JSX.Element | string;
title?: JSX.Element | string;
onOutsideClick?: () => void;
className?: string;
}
export function Modal({ children, title, onOutsideClick }: ModalProps) {
export function Modal({
children,
title,
onOutsideClick,
className,
}: ModalProps) {
return (
<div>
<div
@ -18,6 +24,7 @@ export function Modal({ children, title, onOutsideClick }: ModalProps) {
className={`
bg-gray-800 rounded-sm shadow-lg
shadow-lg relative w-1/2 text-sm
${className}
`}
onClick={(event) => event.stopPropagation()}
>

View File

@ -7,13 +7,8 @@ import { useState } from "react";
import { FiX } from "react-icons/fi";
export function WelcomeModal() {
const [isClosed, setIsClosed] = useState(false);
if (isClosed) {
return null;
}
return (
<Modal>
<Modal className="max-w-4xl">
<div className="px-6 py-4">
<h2 className="text-xl font-bold mb-4 pb-2 border-b border-gray-700 flex">
Welcome to Danswer 🎉