summaryrefslogtreecommitdiffstats
path: root/g4f/gui
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-13 12:47:38 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-13 12:47:38 +0100
commitd2d8d7fb9ee8bbb1b987ac60e3f4fdfbb05d841f (patch)
treeea9c10004b9d3f586888dadcfdc20a9ddf93a5c3 /g4f/gui
parentFix Bing create images, Add gui in webview init (diff)
downloadgpt4free-d2d8d7fb9ee8bbb1b987ac60e3f4fdfbb05d841f.tar
gpt4free-d2d8d7fb9ee8bbb1b987ac60e3f4fdfbb05d841f.tar.gz
gpt4free-d2d8d7fb9ee8bbb1b987ac60e3f4fdfbb05d841f.tar.bz2
gpt4free-d2d8d7fb9ee8bbb1b987ac60e3f4fdfbb05d841f.tar.lz
gpt4free-d2d8d7fb9ee8bbb1b987ac60e3f4fdfbb05d841f.tar.xz
gpt4free-d2d8d7fb9ee8bbb1b987ac60e3f4fdfbb05d841f.tar.zst
gpt4free-d2d8d7fb9ee8bbb1b987ac60e3f4fdfbb05d841f.zip
Diffstat (limited to 'g4f/gui')
-rw-r--r--g4f/gui/client/html/index.html2
-rw-r--r--g4f/gui/client/js/chat.v1.js9
2 files changed, 9 insertions, 2 deletions
diff --git a/g4f/gui/client/html/index.html b/g4f/gui/client/html/index.html
index 85192d23..46a9c541 100644
--- a/g4f/gui/client/html/index.html
+++ b/g4f/gui/client/html/index.html
@@ -189,11 +189,13 @@
<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="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>
diff --git a/g4f/gui/client/js/chat.v1.js b/g4f/gui/client/js/chat.v1.js
index d07597ea..8774fbf1 100644
--- a/g4f/gui/client/js/chat.v1.js
+++ b/g4f/gui/client/js/chat.v1.js
@@ -245,7 +245,7 @@ const ask_gpt = async () => {
jailbreak: jailbreak.options[jailbreak.selectedIndex].value,
web_search: document.getElementById(`switch`).checked,
provider: provider.options[provider.selectedIndex].value,
- patch_provider: document.getElementById('patch').checked,
+ patch_provider: document.getElementById('patch')?.checked,
messages: messages
});
const headers = {
@@ -669,6 +669,9 @@ sidebar_button.addEventListener("click", (event) => {
const register_settings_localstorage = async () => {
for (id of ["switch", "model", "jailbreak", "patch", "provider", "history"]) {
element = document.getElementById(id);
+ if (!element) {
+ continue;
+ }
element.addEventListener('change', async (event) => {
switch (event.target.type) {
case "checkbox":
@@ -687,7 +690,9 @@ const register_settings_localstorage = async () => {
const load_settings_localstorage = async () => {
for (id of ["switch", "model", "jailbreak", "patch", "provider", "history"]) {
element = document.getElementById(id);
- value = appStorage.getItem(element.id);
+ if (!element || !(value = appStorage.getItem(element.id))) {
+ continue;
+ }
if (value) {
switch (element.type) {
case "checkbox":