Skip to content

Commit 5a36fca

Browse files
author
CORRUPTOR2037
committed
fixed bug with formatting not applying on newly generated text, fixed bug with changing authorship on regenerate
1 parent 02ff953 commit 5a36fca

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

webui/session.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -717,4 +717,4 @@ def respond_multi(self, user_input):
717717

718718
def regen_at(self, uuid):
719719
self.api_delete_block(uuid)
720-
return self.respond_multi(self.history.pop().text)
720+
return self.respond_multi('')

webui/static/main.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ function regenChatBlock(uuid, div) {
398398
nextChild.remove();
399399
nextChild = div.nextElementSibling;
400400
}
401-
div.previousElementSibling.remove();
402401
div.remove();
403402

404403
handleOutput("/api/regen_block", { uuid: uuid });
@@ -794,6 +793,7 @@ function processStream(stream) {
794793
// console.log("Received chunk:", decoder.decode(value));
795794
if (done) {
796795
// console.log("Stream complete");
796+
formatter.updateFormatting();
797797
$("#user-input").prop("disabled", false);
798798
$("#user-input").attr('placeholder', 'Type here...');
799799
return;
@@ -828,7 +828,7 @@ var formatter = new (function()
828828
Object.defineProperty(this, 'useItalic', { get(){ return ; } });
829829
Object.defineProperty(this, 'useBold', { get(){ return useBoldToggle.prop('checked'); } });
830830

831-
let updateTagSearcher = this.updateTagSearcher = function()
831+
this.updateTagSearcher = function()
832832
{
833833
if (!useItalicToggle.prop('checked'))
834834
delete tagSearcher['i'];
@@ -839,18 +839,18 @@ var formatter = new (function()
839839
else
840840
tagSearcher['b'] = /(\\?\*){2}/;
841841
}
842-
let updateFormatting = function()
842+
this.updateFormatting = function()
843843
{
844-
updateTagSearcher();
844+
this.updateTagSearcher();
845845
$('#chatbox .text').each(function()
846846
{
847847
let node = $(this);
848848
node.text(' ');
849849
appendWithLineBreaks(this.lastChild, this.parentNode.dataset.text);
850850
});
851851
}
852-
useItalicToggle.on('change', updateFormatting);
853-
useBoldToggle.on('change', updateFormatting);
852+
useItalicToggle.on('change', this.updateFormatting);
853+
useBoldToggle.on('change', this.updateFormatting);
854854
})();
855855

856856
function appendWithLineBreaks(currentNode, text)

0 commit comments

Comments
 (0)