fix: merge conflict

This commit is contained in:
Yidadaa
2023-04-27 01:18:09 +08:00
7 changed files with 61 additions and 34 deletions

View File

@@ -472,7 +472,7 @@ export function Chat() {
}
};
const findLastUesrIndex = (messageId: number) => {
const findLastUserIndex = (messageId: number) => {
// find last user input message and resend
let lastUserMessageIndex: number | null = null;
for (let i = 0; i < session.messages.length; i += 1) {
@@ -495,14 +495,14 @@ export function Chat() {
};
const onDelete = (botMessageId: number) => {
const userIndex = findLastUesrIndex(botMessageId);
const userIndex = findLastUserIndex(botMessageId);
if (userIndex === null) return;
deleteMessage(userIndex);
};
const onResend = (botMessageId: number) => {
// find last user input message and resend
const userIndex = findLastUesrIndex(botMessageId);
const userIndex = findLastUserIndex(botMessageId);
if (userIndex === null) return;
setIsLoading(true);

View File

@@ -12,7 +12,7 @@ const tw: LocaleType = {
Chat: {
SubTitle: (count: number) => `您已經與 ChatGPT 進行了 ${count} 條對話`,
Actions: {
ChatList: "查看息列表",
ChatList: "查看息列表",
CompressedHistory: "查看壓縮後的歷史 Prompt",
Export: "匯出聊天紀錄",
Copy: "複製",
@@ -36,10 +36,10 @@ const tw: LocaleType = {
},
},
Export: {
Title: "匯出聊天記錄為 Markdown",
Title: "聊天記錄匯出為 Markdown",
Copy: "複製全部",
Download: "下載檔案",
MessageFromYou: "來自的訊息",
MessageFromYou: "來自的訊息",
MessageFromChatGPT: "來自 ChatGPT 的訊息",
},
Memory: {
@@ -47,8 +47,8 @@ const tw: LocaleType = {
EmptyContent: "尚未記憶",
Copy: "複製全部",
Send: "發送記憶",
Reset: "重對話",
ResetConfirm: "重後將清空當前對話記錄以及歷史記憶,確認重",
Reset: "重對話",
ResetConfirm: "重後將清除目前對話記錄以及歷史記憶,確認重",
},
Home: {
NewChat: "新的對話",
@@ -60,14 +60,14 @@ const tw: LocaleType = {
Title: "設定",
SubTitle: "設定選項",
Actions: {
ClearAll: "清除所有數據",
ResetAll: "重所有設定",
ClearAll: "清除所有資料",
ResetAll: "重所有設定",
Close: "關閉",
ConfirmResetAll: {
Confirm: "Are you sure you want to reset all configurations?",
Confirm: "您確定要重設所有設定嗎?",
},
ConfirmClearAll: {
Confirm: "Are you sure you want to reset all chat?",
Confirm: "您確定要清除所有聊天嗎?",
},
},
Lang: {
@@ -103,16 +103,16 @@ const tw: LocaleType = {
SendPreviewBubble: "發送預覽氣泡",
Prompt: {
Disable: {
Title: "停用提示詞自動補",
SubTitle: "在輸入框開頭輸入 / 即可觸發自動補",
Title: "停用提示詞自動補",
SubTitle: "在輸入框開頭輸入 / 即可觸發自動補",
},
List: "自定義提示詞列表",
ListCount: (builtin: number, custom: number) =>
` ${builtin} 條,用戶定義 ${custom}`,
` ${builtin} 條,用戶定義 ${custom}`,
Edit: "編輯",
Modal: {
Title: "提示詞列表",
Add: "增一條",
Add: "增一條",
Search: "搜尋提示詞",
},
},
@@ -126,13 +126,13 @@ const tw: LocaleType = {
},
Token: {
Title: "API Key",
SubTitle: "使用自己的 Key 可規避授權訪問限制",
SubTitle: "使用自己的 Key 可規避授權存取限制",
Placeholder: "OpenAI API Key",
},
Usage: {
Title: "帳戶餘額",
SubTitle(used: any, total: any) {
return `本月已使用 $${used}订阅总额 $${total}`;
return `本月已使用 $${used}訂閱總額 $${total}`;
},
IsChecking: "正在檢查…",
Check: "重新檢查",
@@ -140,17 +140,17 @@ const tw: LocaleType = {
},
AccessCode: {
Title: "授權碼",
SubTitle: "現在是未授權訪問狀態",
SubTitle: "目前是未授權存取狀態",
Placeholder: "請輸入授權碼",
},
Model: "模型 (model)",
Temperature: {
Title: "隨機性 (temperature)",
SubTitle: "值越大,回越隨機",
SubTitle: "值越大,回越隨機",
},
MaxTokens: {
Title: "單次回限制 (max_tokens)",
SubTitle: "單次互所用的最大 Token 數",
Title: "單次回限制 (max_tokens)",
SubTitle: "單次互所用的最大 Token 數",
},
PresencePenlty: {
Title: "話題新穎度 (presence_penalty)",
@@ -169,16 +169,16 @@ const tw: LocaleType = {
Summarize:
"Use the language used by the user (e.g. en-us for english conversation, zh-hant for chinese conversation, etc.) to summarise the conversation in at most 200 words. The summary will be used as prompt for you to continue the conversation in the future.",
},
ConfirmClearAll: "確認清除所有對話、設定數據",
ConfirmClearAll: "確認清除所有對話、設定?",
},
Copy: {
Success: "已複製到剪貼簿中",
Failed: "複製失敗,請賦予剪貼簿權限",
},
Context: {
Toast: (x: any) => `已設 ${x} 條前置上下文`,
Toast: (x: any) => `已設 ${x} 條前置上下文`,
Edit: "前置上下文和歷史記憶",
Add: "新增條",
Add: "新增條",
},
Mask: {
Page: {

View File

@@ -101,6 +101,7 @@ body {
justify-content: center;
align-items: center;
user-select: none;
touch-action: pan-x pan-y;
font-family: "Noto Sans SC", "SF Pro SC", "SF Pro Text", "SF Pro Icons",
"PingFang SC", "Helvetica Neue", "Helvetica", "Arial", sans-serif;