From 63ecf3b398d41a2a03b0fd147cdada31c78501e0 Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Fri, 12 Jul 2024 21:11:06 +0300
Subject: [PATCH] Remember proxy without confirmation
---
public/scripts/openai.js | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/public/scripts/openai.js b/public/scripts/openai.js
index ba5cbcee1..2886778e3 100644
--- a/public/scripts/openai.js
+++ b/public/scripts/openai.js
@@ -416,21 +416,16 @@ async function validateReverseProxy() {
const rememberKey = `Proxy_SkipConfirm_${getStringHash(oai_settings.reverse_proxy)}`;
const skipConfirm = localStorage.getItem(rememberKey) === 'true';
- const confirmation = skipConfirm || await Popup.show.confirm('Connecting To Proxy', `Are you sure you want to connect to the following proxy URL?${oai_settings.reverse_proxy}`, {
- customInputs: [{ id: 'proxy-remember', label: 'Don\'t ask again for this proxy URL' }],
- onClose: popup => {
- if (popup.result) {
- const rememberValue = popup.inputResults.get('proxy-remember');
- localStorage.setItem(rememberKey, String(rememberValue));
- }
- },
- });
+ const confirmation = skipConfirm || await Popup.show.confirm('Connecting To Proxy', `Are you sure you want to connect to the following proxy URL?${DOMPurify.sanitize(oai_settings.reverse_proxy)}`);
+
if (!confirmation) {
toastr.error('Update or remove your reverse proxy settings.');
setOnlineStatus('no_connection');
resultCheckStatus();
throw new Error('Proxy connection denied.');
}
+
+ localStorage.setItem(rememberKey, String(true));
}
/**