diff --git a/index.html b/index.html
index 5442313..0196b9a 100644
--- a/index.html
+++ b/index.html
@@ -39,7 +39,7 @@
Text-to-Audio Converter
-
Es ist ein Fehler bei der Anfrage aufgetreten.
Bist du dir sicher das genug Guthaben verfügbar ist?
+
An error occured calling the OpenAI API:
Are you sure that the entered key is valid and that there is enough credit balance on your account?
diff --git a/main.js b/main.js
index f12bdd0..3ed8fb6 100644
--- a/main.js
+++ b/main.js
@@ -85,6 +85,7 @@ function generateAudiobook() {
var segments = splitTextIntoSegments(text, 4000);
var audioBlobs = new Array(segments.length);
var progressBar = document.getElementById('progressbar1');
+ document.getElementById('error-indicator').style.display = 'none';
progressBar.max = segments.length;
progressBar.value = 0;
@@ -148,7 +149,6 @@ function callOpenAIAPI(segment, apiKey, callback) {
if (xhr.status === 200) {
var audioBlob = xhr.response;
callback(audioBlob);
- document.getElementById('error-indicator').style.display = 'none';
} else {
console.error("Error calling OpenAI API: " + xhr.statusText);
document.getElementById('error-indicator').style.display = 'block';