Skip to content

Commit

Permalink
Fix issue 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Weber committed Dec 13, 2023
1 parent a357f7d commit 2ac98f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ <h1>Text-to-Audio Converter</h1>
<div id="generate-section">
<button id="generate-audiobook">Generate Audiobook</button>
</div>

<!-- Error Indicator (Hidden Initially) -->
<div id="error-indicator" style="display: none;">
<p style="color:red;">Es ist ein Fehler bei der Anfrage aufgetreten. <br/> Bist du dir sicher das genug Guthaben verfügbar ist?</p>
</div>
<!-- Progress Indicator (Hidden Initially) -->
<div id="progress-indicator" style="display: none;">
<p>Converting...</p>
Expand Down
2 changes: 2 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ 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';
}
};

Expand Down

0 comments on commit 2ac98f3

Please sign in to comment.