Skip to content

Commit

Permalink
Iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed Jun 19, 2024
1 parent 097901d commit 72bdc9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
6 changes: 2 additions & 4 deletions web-app/src/components/ai/empty-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import Text from "../base/Text";
export function EmptyScreen({
setInput,
contextMessage,
indexIds,
defaultQuestions,
}: {
setInput: (input: string) => void;
contextMessage: string;
indexIds?: string[];
defaultQuestions?: string[];
}) {
return (
Expand All @@ -36,8 +34,8 @@ export function EmptyScreen({
</Text>
</div>
<div className="example-messages-empty-screen">
{indexIds &&
indexIds.length > 0 &&
{defaultQuestions &&
defaultQuestions.length > 0 &&
defaultQuestions?.map((message, i) => (
<ExampleMessageBox key={i} message={message} setInput={setInput} />
))}
Expand Down
10 changes: 2 additions & 8 deletions web-app/src/components/site/indexes/AskIndexes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const AskIndexes: FC<AskIndexesProps> = ({ sources }) => {
conversations,
setConversations,
} = useApp();
const { isIndex, conversationId, id } = useRouteParams();
const { isIndex, isConversation, conversationId, id } = useRouteParams();
const { view } = useApp();
const { ready: apiReady, api } = useApi();

Expand All @@ -75,7 +75,7 @@ const AskIndexes: FC<AskIndexesProps> = ({ sources }) => {
const bottomRef = useRef<null | HTMLDivElement>(null);

const fetchDefaultQuestions = useCallback(async (): Promise<void> => {
if (!apiReady || !isIndex || !id) return;
if (!apiReady || isConversation || !id) return;
try {
const questions = await api!.getDefaultQuestionsOfIndex([id]);
setDefaultQuestions(questions);
Expand Down Expand Up @@ -432,12 +432,6 @@ const AskIndexes: FC<AskIndexesProps> = ({ sources }) => {
<EmptyScreen
contextMessage={getChatContextMessage()}
setInput={setInput}
indexIds={
viewedConversation &&
viewedConversation.sources?.filter(
(source) => !source.includes("did:"),
)
}
defaultQuestions={defaultQuestions}
/>
</Flex>
Expand Down

0 comments on commit 72bdc9f

Please sign in to comment.