diff --git a/src/renderer/src/i18n/en-us.json b/src/renderer/src/i18n/en-us.json index 4b4e1eb4..06b366a8 100644 --- a/src/renderer/src/i18n/en-us.json +++ b/src/renderer/src/i18n/en-us.json @@ -107,6 +107,7 @@ "add.assistant.title": "Add Assistant", "message.new.context": "New Context", "message.new.branch": "New Branch", + "message.new.branch.created": "New Branch Created", "assistant.search.placeholder": "Search", "artifacts.button.preview": "Preview", "artifacts.button.download": "Download" diff --git a/src/renderer/src/i18n/zh-cn.json b/src/renderer/src/i18n/zh-cn.json index 6ee67cc3..a2e6d313 100644 --- a/src/renderer/src/i18n/zh-cn.json +++ b/src/renderer/src/i18n/zh-cn.json @@ -81,7 +81,7 @@ "topics.export.image": "导出为图片", "input.new_topic": "新话题", "input.topics": " 话题 ", - "input.clear": "清除会话消息", + "input.clear": "清空消息", "input.new.context": "清除上下文", "input.expand": "展开", "input.collapse": "收起", @@ -107,6 +107,7 @@ "add.assistant.title": "添加助手", "message.new.context": "清除上下文", "message.new.branch": "新分支", + "message.new.branch.created": "新分支已创建", "assistant.search.placeholder": "搜索", "artifacts.button.preview": "预览", "artifacts.button.download": "下载" diff --git a/src/renderer/src/i18n/zh-tw.json b/src/renderer/src/i18n/zh-tw.json index c7e8bd1a..3fb80a85 100644 --- a/src/renderer/src/i18n/zh-tw.json +++ b/src/renderer/src/i18n/zh-tw.json @@ -107,6 +107,7 @@ "add.assistant.title": "添加助手", "message.new.context": "新上下文", "message.new.branch": "新分支", + "message.new.branch.created": "新分支已建立", "assistant.search.placeholder": "搜尋", "artifacts.button.preview": "預覽", "artifacts.button.download": "下載" diff --git a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx index e5ef1d89..95ba8b8d 100644 --- a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx +++ b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx @@ -129,8 +129,10 @@ const Inputbar: FC = ({ assistant, setActiveTopic }) => { const addNewTopic = useCallback(() => { const topic = getDefaultTopic(assistant.id) + addTopic(topic) setActiveTopic(topic) + db.topics.add({ id: topic.id, messages: [] }) }, [addTopic, assistant.id, setActiveTopic]) diff --git a/src/renderer/src/pages/home/Navbar.tsx b/src/renderer/src/pages/home/Navbar.tsx index 31ed47c4..e4774a63 100644 --- a/src/renderer/src/pages/home/Navbar.tsx +++ b/src/renderer/src/pages/home/Navbar.tsx @@ -11,7 +11,6 @@ import { EVENT_NAMES, EventEmitter } from '@renderer/services/event' import { Assistant, Topic } from '@renderer/types' import { Switch } from 'antd' import { FC, useCallback } from 'react' -import { useTranslation } from 'react-i18next' import styled from 'styled-components' import SelectModelButton from './components/SelectModelButton' @@ -28,13 +27,11 @@ const HeaderNavbar: FC = ({ activeAssistant }) => { const { theme, toggleTheme } = useTheme() const { topicPosition } = useSettings() const { showTopics, toggleShowTopics } = useShowTopics() - const { t } = useTranslation() const addNewTopic = useCallback(() => { EventEmitter.emit(EVENT_NAMES.ADD_NEW_TOPIC) - window.message.success({ content: t('message.topic.added'), key: 'topic-added' }) setTimeout(() => EventEmitter.emit(EVENT_NAMES.SHOW_TOPIC_SIDEBAR), 0) - }, [t]) + }, []) return (