mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Guard against empty prompts
This commit is contained in:
@ -494,7 +494,11 @@ function returnWiList(ar) {
|
||||
}
|
||||
|
||||
function dosubmit() {
|
||||
var txt = input_text.val();
|
||||
var txt = input_text.val().replace(/\u00a0/g, " ");
|
||||
console.log(gamestarted)
|
||||
if(!gamestarted && ((!adventure || !action_mode) && txt.trim().length == 0)) {
|
||||
return;
|
||||
}
|
||||
socket.send({'cmd': 'submit', 'actionmode': adventure ? action_mode : 0, 'data': txt});
|
||||
if(memorymode) {
|
||||
memorytext = input_text.val();
|
||||
@ -882,7 +886,7 @@ function syncAllModifiedChunks(including_selected_chunks=false) {
|
||||
}
|
||||
|
||||
function restorePrompt() {
|
||||
if(game_text[0].firstChild.nodeType === 3) {
|
||||
if(game_text[0].firstChild && game_text[0].firstChild.nodeType === 3) {
|
||||
saved_prompt = game_text[0].firstChild.textContent.replace(/\u00a0/g, " ");
|
||||
unbindGametext();
|
||||
game_text[0].innerText = "";
|
||||
|
Reference in New Issue
Block a user