Skip to content

Commit

Permalink
Add user signIn check
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaapple committed Oct 21, 2024
1 parent 2217b53 commit 178bc1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/components/search/search-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ const SearchBar: React.FC<Props> = ({
};

const handleClick = () => {
if (!user) {
signInModal.onOpen();
return;
}
if (checkEmptyInput()) {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions frontend/components/search/search-window.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export default function SearchWindow({ id, initialMessages, user, isReadOnly = f

const sendMessage = useCallback(
async (question?: string, attachments?: string[], messageIdToUpdate?: string) => {
if (!user) {
signInModal.onOpen();
return;
}
if (isReadOnly) {
toast.error(t('read-only-error'));
return;
Expand Down

0 comments on commit 178bc1c

Please sign in to comment.