Check for response ok

2e661c36e5067de68bd6fd8b470c27a8e35c2264

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

1 files changed, +2 -0Showing whitespace changes
public/script.js+2 -0
@@ -1249,6 +1249,7 @@ async function getStatusTextgen() {
1249 }),1249 }),
1250 });1250 });
12511251
1252 if (response.ok) {
1252 const data = await response.json();1253 const data = await response.json();
1253 if (data) {1254 if (data) {
1254 const { chat_template, chat_template_hash } = data;1255 const { chat_template, chat_template_hash } = data;
@@ -1265,6 +1266,7 @@ async function getStatusTextgen() {
1265 }1266 }
1266 }1267 }
1267 }1268 }
1269 }
12681270
1269 // We didn't get a 200 status code, but the endpoint has an explanation. Which means it DID connect, but I digress.1271 // We didn't get a 200 status code, but the endpoint has an explanation. Which means it DID connect, but I digress.
1270 if (online_status === 'no_connection' && data.response) {1272 if (online_status === 'no_connection' && data.response) {