summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-25 21:06:51 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-25 21:06:51 +0100
commit347d3f92da458520b30e91e56bd66e472e084e70 (patch)
tree8fa21c18ce4380b89db814687483530f01fe506d /g4f/gui/server
parentMerge pull request #1744 from igeni/concat2fstr (diff)
downloadgpt4free-347d3f92da458520b30e91e56bd66e472e084e70.tar
gpt4free-347d3f92da458520b30e91e56bd66e472e084e70.tar.gz
gpt4free-347d3f92da458520b30e91e56bd66e472e084e70.tar.bz2
gpt4free-347d3f92da458520b30e91e56bd66e472e084e70.tar.lz
gpt4free-347d3f92da458520b30e91e56bd66e472e084e70.tar.xz
gpt4free-347d3f92da458520b30e91e56bd66e472e084e70.tar.zst
gpt4free-347d3f92da458520b30e91e56bd66e472e084e70.zip
Diffstat (limited to '')
-rw-r--r--g4f/gui/server/api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py
index e7683812..11b28dda 100644
--- a/g4f/gui/server/api.py
+++ b/g4f/gui/server/api.py
@@ -135,6 +135,7 @@ class Api():
camera.take_picture(filename=filename, on_complete=self.on_camera)
def on_image_selection(self, filename):
+ filename = filename[0] if isinstance(filename, list) else filename
if filename is not None and os.path.exists(filename):
self.image = filename
else:
@@ -152,7 +153,7 @@ class Api():
window = webview.windows[0]
if window is not None:
window.evaluate_js(
- f"document.querySelector(`.file-label.selected`)?.classList.remove(`selected`);"
+ f"document.querySelector(`.image-label.selected`)?.classList.remove(`selected`);"
)
if input_id is not None and input_id in ("image", "camera"):
window.evaluate_js(