Skip to content

Commit 89a477d

Browse files
author
Bogdan Tsechoev
committed
Reduce unused code
1 parent be6f035 commit 89a477d

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

ui/packages/platform/src/pages/Bot/index.tsx

+1-21
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { useAiBot } from "./hooks";
2020
import { usePrev } from "../../hooks/usePrev";
2121
import {HeaderButtons} from "./HeaderButtons/HeaderButtons";
2222
import settings from "../../utils/settings";
23-
import { SaveChangesFunction, SettingsDialog } from "./SettingsDialog/SettingsDialog";
23+
import { SettingsDialog } from "./SettingsDialog/SettingsDialog";
2424
import { theme } from "@postgres.ai/shared/styles/theme";
2525
import { colors } from "@postgres.ai/shared/styles/colors";
2626
import { SettingsPanel } from "./SettingsPanel/SettingsPanel";
@@ -99,8 +99,6 @@ export const BotPage = (props: BotPageProps) => {
9999
clearChat,
100100
changeChatVisibility,
101101
unsubscribe,
102-
model,
103-
setModel,
104102
getDebugMessagesForWholeThread,
105103
getChatsList,
106104
} = useAiBot();
@@ -109,7 +107,6 @@ export const BotPage = (props: BotPageProps) => {
109107

110108
const [isChatsListVisible, setChatsListVisible] = useState(window?.innerWidth > 640);
111109
const [isSettingsDialogVisible, setSettingsDialogVisible] = useState(false);
112-
const [chatVisibility, setChatVisibility] = useState<'public' | 'private'>('public');
113110
const [isDebugConsoleVisible, setDebugConsoleVisible] = useState(false);
114111

115112
const history = useHistory();
@@ -152,23 +149,6 @@ export const BotPage = (props: BotPageProps) => {
152149
history.push(`/${match.params.org}/bot`);
153150
}
154151

155-
const handleSaveChatVisibility = (value: boolean) => {
156-
if (match.params.threadId) {
157-
changeChatVisibility(match.params.threadId, value)
158-
getChatsList();
159-
}
160-
}
161-
162-
const handleSaveSettings: SaveChangesFunction = ( _model, _visibility) => {
163-
if (_model !== model) {
164-
setModel(_model)
165-
}
166-
if (_visibility !== chatVisibility) {
167-
handleSaveChatVisibility( _visibility === 'public')
168-
}
169-
toggleSettingsDialog();
170-
}
171-
172152
const handleChatListLinkClick = (targetThreadId: string) => {
173153
if (match.params.threadId && match.params.threadId !== targetThreadId) {
174154
unsubscribe(match.params.threadId)

0 commit comments

Comments
 (0)