fix typos

This commit is contained in:
James Feng Cao 2023-04-05 12:09:09 +08:00
parent 74511d89e0
commit 2ac6107614
3 changed files with 20 additions and 14 deletions

View file

@ -48,13 +48,17 @@ function onMessage(json, returnMessage) {
if (json.type == 3) {
onMessageIsOKClose = true;
returnMessage.getCatWebSocket().close(1000, 'ok');
} else if (json.type == 1) {
porserArguments(json.arguments);
} else if (json.type == 2) {
porserType2Item(json.item);
} else {
console.log(JSON.stringify(json));
}
talk = undefined;
localStorage.removeItem('LastChatJson');
if (json.type == 1) {
porserArguments(json.arguments);
} else if (json.type == 2) {
porserType2Item(json.item);
} else {
console.log(JSON.stringify(json));
}
}
}
@ -289,7 +293,7 @@ input_update_input_text_sstyle_show_update({ target: input_text });
//开始新聊天按钮逻辑,仅在聊天复用
restartNewChat.onclick = async () => {
await setLastChatJson(null);
localStorage.removeItem('LastChatJson');
await setLastInvocationId(1);
restart_button.onclick();
}

View file

@ -348,7 +348,7 @@ class Chat {
}
}
function URLTrue(magicUrl, thiePath) {
function URLTrue(url, thiePath) {
return url + thiePath;
}
@ -367,9 +367,10 @@ async function copyCookies(magicUrl) {}
}
*/
async function createChat(theChatType) {
let chatWithMagic = await getChatHubWithMagic();
let magicUrl = await getMagicUrl();
let restartNewChat = document.getElementById('restartNewChat');
let chatWithMagic = await getChatHubWithMagic();
let magicUrl = await getMagicUrl();
let restartNewChat = document.getElementById('restartNewChat');
if(chatWithMagic=='repeat'){//如果是聊天复用
restartNewChat.classList.remove('onShow');
let resjson = await getLastChatJson();
@ -385,11 +386,12 @@ async function createChat(theChatType) {
};
}
}
let mes;
do {
try {
let res = await fetch(URLTrue(magicUrl,'turing/conversation/create'),
{credentials: 'include'});
let url = URLTrue(magicUrl,'turing/conversation/create');
let res = await fetch(url, {credentials: 'include'});
let resjson = await res.json();
if (!resjson.result || resjson.result.value != 'Success') {
mes = resjson;

View file

@ -57,7 +57,7 @@ body>ul{padding-left:0;}
<li><label><input type="checkbox" onchange="location.href='i:2516777216'"/>Block dubious resources when blocking external scripts</label></li>
<li><label><input type="checkbox" onchange="location.href='i:2533554432'"/>Use termux</label></li>
<li><label><input type="checkbox" onchange="location.href='i:2567108864'"/>webview debug</label></li>
<li><label><input type="checkbox" onchange="location.href='i:25134217728'"/>fullscreen playing w/o ligntness & volumn gestures</label></li>
<li><label><input type="checkbox" onchange="location.href='i:25134217728'"/>fullscreen playing w/o brightness & volumn gestures</label></li>
</ul>
<script>
checkBoxes=document.getElementsByTagName("input");