mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Added fix for UI2 to now show the back value when there is only one option (use redo to go restore it)
This commit is contained in:
@@ -266,6 +266,30 @@ function create_options(action) {
|
||||
while (option_chunk.firstChild) {
|
||||
option_chunk.removeChild(option_chunk.firstChild);
|
||||
}
|
||||
|
||||
//Let's check if we only have a single redo option. In that case we din't show as the user can use the redo button
|
||||
seen_prev_selection = false;
|
||||
show_options = false;
|
||||
console.log(action.action.Options);
|
||||
for (item of action.action.Options) {
|
||||
if (!(item['Previous Selection'])) {
|
||||
console.log(item);
|
||||
show_options = true;
|
||||
break;
|
||||
} else if (item['Previous Selection']) {
|
||||
if (seen_prev_selection) {
|
||||
show_options = true;
|
||||
break;
|
||||
} else {
|
||||
seen_prev_selection = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log("seen_prev_selection: "+seen_prev_selection+" show_options: "+show_options);
|
||||
if (!(show_options)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var table = document.createElement("div");
|
||||
table.classList.add("sequences");
|
||||
//Add Redo options
|
||||
|
Reference in New Issue
Block a user