From f24b6e78a37b9827fe106429319348273a04cf90 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 26 Feb 2023 23:58:04 -0300 Subject: [PATCH] Fix clear history --- modules/chat.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/chat.py b/modules/chat.py index 82e21d6f..25e66e16 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -216,11 +216,16 @@ def clear_html(): def clear_chat_log(name1, name2): if shared.character != 'None': + found = False for i in range(len(shared.history['internal'])): if '<|BEGIN-VISIBLE-CHAT|>' in shared.history['internal'][i][0]: shared.history['visible'] = [['', apply_extensions(shared.history['internal'][i][1], "output")]] shared.history['internal'] = shared.history['internal'][:i+1] + found = True break + if not found: + shared.history['visible'] = [] + shared.history['internal'] = [] else: shared.history['internal'] = [] shared.history['visible'] = []