Ashrafb commited on
Commit
e692c7f
1 Parent(s): 6d9f633

Update static/index.html

Browse files
Files changed (1) hide show
  1. static/index.html +1 -13
static/index.html CHANGED
@@ -199,11 +199,6 @@
199
  document.getElementById(spinnerId).style.display = 'none';
200
  }
201
 
202
- function displayErrorMessage(message) {
203
- const imageBox = document.getElementById("image-box");
204
- imageBox.innerHTML = `<p>${message}</p>`;
205
- }
206
-
207
  function generatePrompts() {
208
  showSpinner('promptSpinner');
209
  const prompt = document.getElementById("prompt").value;
@@ -224,12 +219,7 @@
224
  const inputs = document.getElementById("inputs").value;
225
  const noiseLevel = document.getElementById("noise_level").value;
226
  fetch(`/send_inputs?inputs=${encodeURIComponent(inputs)}&noise_level=${noiseLevel}`)
227
- .then(response => {
228
- if (!response.ok) {
229
- throw new Error('Server Error: ' + response.status);
230
- }
231
- return response.json();
232
- })
233
  .then(data => {
234
  const imageBox = document.getElementById("image-box");
235
  const img = new Image();
@@ -247,10 +237,8 @@
247
  .catch(error => {
248
  console.error('Error:', error);
249
  hideSpinner('sendSpinner');
250
- displayErrorMessage('Error occurred while processing the image.');
251
  });
252
  }
253
  </script>
254
-
255
  </body>
256
  </html>
 
199
  document.getElementById(spinnerId).style.display = 'none';
200
  }
201
 
 
 
 
 
 
202
  function generatePrompts() {
203
  showSpinner('promptSpinner');
204
  const prompt = document.getElementById("prompt").value;
 
219
  const inputs = document.getElementById("inputs").value;
220
  const noiseLevel = document.getElementById("noise_level").value;
221
  fetch(`/send_inputs?inputs=${encodeURIComponent(inputs)}&noise_level=${noiseLevel}`)
222
+ .then(response => response.json())
 
 
 
 
 
223
  .then(data => {
224
  const imageBox = document.getElementById("image-box");
225
  const img = new Image();
 
237
  .catch(error => {
238
  console.error('Error:', error);
239
  hideSpinner('sendSpinner');
 
240
  });
241
  }
242
  </script>
 
243
  </body>
244
  </html>