Skip to content

Commit

Permalink
Add indexes link to user Avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaapple committed Jan 9, 2025
1 parent cd0ee01 commit faa4381
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
11 changes: 4 additions & 7 deletions frontend/app/api/search/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ const updateSource = function (model, source, messages, isSearch) {
if (model === O1_MIMI || model === O1_PREVIEW) {
return SearchCategory.O1;
}
const file = messages[0].attachments?.[0];
if (file && file.startsWith('local-')) {
return SearchCategory.KNOWLEDGE_BASE;
}
if (!isSearch) {
return SearchCategory.CHAT;
}
const file = messages[0].attachments?.[0];
if (file) {
if (file.startsWith('local-')) {
return SearchCategory.KNOWLEDGE_BASE;
}
return SearchCategory.ALL;
}
const query = messages[messages.length - 1].content;
if (containsValidUrl(query)) {
return SearchCategory.ALL;
Expand Down
20 changes: 13 additions & 7 deletions frontend/components/layout/user-account-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import Link from 'next/link';
import { Gem, Images, LogOut, Settings } from 'lucide-react';
import { Gem, Images, LogOut, Settings, SquareLibrary } from 'lucide-react';
import type { User } from 'next-auth';
import { signOut } from 'next-auth/react';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
Expand Down Expand Up @@ -50,9 +50,9 @@ export function UserAccountNav({ user }: UserAccountNavProps) {
</div>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Link prefetch={false} href="/images" className="flex items-center space-x-2.5">
<Images className="size-4" />
<p className="text-sm">Images</p>
<Link prefetch={false} href="/pricing" className="flex items-center space-x-2.5">
<Gem className="size-4" />
<p className="text-sm">Upgrade Plan</p>
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
Expand All @@ -62,9 +62,15 @@ export function UserAccountNav({ user }: UserAccountNavProps) {
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link prefetch={false} href="/pricing" className="flex items-center space-x-2.5">
<Gem className="size-4" />
<p className="text-sm">Upgrade Plan</p>
<Link prefetch={false} href="/indexes" className="flex items-center space-x-2.5">
<SquareLibrary className="size-4" />
<p className="text-sm">Indexes</p>
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link prefetch={false} href="/images" className="flex items-center space-x-2.5">
<Images className="size-4" />
<p className="text-sm">Images</p>
</Link>
</DropdownMenuItem>
<DropdownMenuSeparator />
Expand Down

0 comments on commit faa4381

Please sign in to comment.