More chatgpt modifications

This commit is contained in:
Igor Katson 2023-11-20 22:10:01 +00:00
parent 88ca5960df
commit aef1ffbd90
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
4 changed files with 21 additions and 21 deletions

View file

@ -1,5 +1,5 @@
// Define API URL and base path
const apiUrl = 'http://localhost:3030';
const apiUrl = window.origin == 'null' ? 'http://localhost:3030' : '';
// Interface for the Torrent API response
interface Torrent {
@ -149,10 +149,8 @@ async function displayTorrents(): Promise<void> {
// Replace the old content with the new one
const outputDiv = document.getElementById('output');
if (outputDiv) {
outputDiv.innerHTML = '';
outputDiv.appendChild(torrentsContainer);
}
outputDiv.innerHTML = '';
outputDiv.appendChild(torrentsContainer);
} catch (error) {
console.error(error);
}