Remember proxy without confirmation

63ecf3b398d41a2a03b0fd147cdada31c78501e0

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -9Showing whitespace changes
public/scripts/openai.js+4 -9
@@ -416,21 +416,16 @@ async function validateReverseProxy() {
416 const rememberKey = `Proxy_SkipConfirm_${getStringHash(oai_settings.reverse_proxy)}`;416 const rememberKey = `Proxy_SkipConfirm_${getStringHash(oai_settings.reverse_proxy)}`;
417 const skipConfirm = localStorage.getItem(rememberKey) === 'true';417 const skipConfirm = localStorage.getItem(rememberKey) === 'true';
418418
419 const confirmation = skipConfirm || await Popup.show.confirm('Connecting To Proxy', `<span>Are you sure you want to connect to the following proxy URL?</span><var>${oai_settings.reverse_proxy}</var>`, {419 const confirmation = skipConfirm || await Popup.show.confirm('Connecting To Proxy', `<span>Are you sure you want to connect to the following proxy URL?</span><var>${DOMPurify.sanitize(oai_settings.reverse_proxy)}</var>`);
420 customInputs: [{ id: 'proxy-remember', label: 'Don\'t ask again for this proxy URL' }],420
421 onClose: popup => {
422 if (popup.result) {
423 const rememberValue = popup.inputResults.get('proxy-remember');
424 localStorage.setItem(rememberKey, String(rememberValue));
425 }
426 },
427 });
428 if (!confirmation) {421 if (!confirmation) {
429 toastr.error('Update or remove your reverse proxy settings.');422 toastr.error('Update or remove your reverse proxy settings.');
430 setOnlineStatus('no_connection');423 setOnlineStatus('no_connection');
431 resultCheckStatus();424 resultCheckStatus();
432 throw new Error('Proxy connection denied.');425 throw new Error('Proxy connection denied.');
433 }426 }
427
428 localStorage.setItem(rememberKey, String(true));
434}429}
435430
436/**431/**