Skip to content

Commit

Permalink
fix state transition of search
Browse files Browse the repository at this point in the history
  • Loading branch information
jackalcooper committed Feb 19, 2025
1 parent eb4d463 commit c07fa74
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,14 @@ export function ChatActions(props: {
onClick={() => {
const newDeepThinking = !isDeepThinking;
setDeepThinking(newDeepThinking);
updateModel(newDeepThinking, isPro, isSearch);

let newSearch = isSearch;
if (!newDeepThinking) {
newSearch = newDeepThinking;
setSearch(newSearch);
}

updateModel(newDeepThinking, isPro, newSearch);
}}
text={"深度思考"}
active={isDeepThinking}
Expand All @@ -709,7 +716,14 @@ export function ChatActions(props: {
onClick={() => {
const newPro = !isPro;
setPro(newPro);
updateModel(isDeepThinking, newPro, isSearch);

let newSearch = isSearch;
if (!newPro) {
newSearch = newPro;
setSearch(newSearch);
}

updateModel(isDeepThinking, newPro, newSearch);
}}
text={"Pro"}
active={isPro}
Expand All @@ -718,9 +732,6 @@ export function ChatActions(props: {
icon={<SearchIcon />}
onClick={() => {
const newSearch = !isSearch;
appConfig.update((config) => {
config.search = newSearch;
});
setSearch(newSearch);
if (newSearch) {
setPro(true);
Expand Down

0 comments on commit c07fa74

Please sign in to comment.