Add disable history button in GUI

pull/1575/head
Heiner Lohaus 4 months ago
parent 333fb4d2c3
commit 76ec2064ad

@ -168,14 +168,19 @@
</div>
<div class="field">
<input type="checkbox" id="switch" />
<label for="switch"></label>
<label for="switch" title="Add the pages of the first 5 search results to the query."></label>
<span class="about">Web Access</span>
</div>
<div class="field">
<input type="checkbox" id="patch" />
<label for="patch" title="Works only with Bing and some other providers"></label>
<label for="patch" title="Enable create images with Bing."></label>
<span class="about">Image Generator</span>
</div>
<div class="field">
<input type="checkbox" id="history" />
<label for="history" title="To improve the reaction time or if you have trouble with large conversations."></label>
<span class="about">Disable History</span>
</div>
</div>
</div>
</div>

@ -100,6 +100,11 @@ const ask_gpt = async () => {
delete messages[i]["provider"];
}
// Remove history, if it is selected
if (document.getElementById('history')?.checked) {
messages = [messages[messages.length-1]]
}
window.scrollTo(0, 0);
window.controller = new AbortController();
@ -491,7 +496,7 @@ document.querySelector(".mobile-sidebar").addEventListener("click", (event) => {
});
const register_settings_localstorage = async () => {
for (id of ["switch", "model", "jailbreak", "patch", "provider"]) {
for (id of ["switch", "model", "jailbreak", "patch", "provider", "history"]) {
element = document.getElementById(id);
element.addEventListener('change', async (event) => {
switch (event.target.type) {
@ -509,7 +514,7 @@ const register_settings_localstorage = async () => {
}
const load_settings_localstorage = async () => {
for (id of ["switch", "model", "jailbreak", "patch", "provider"]) {
for (id of ["switch", "model", "jailbreak", "patch", "provider", "history"]) {
element = document.getElementById(id);
value = localStorage.getItem(element.id);
if (value) {

Loading…
Cancel
Save