From 1b1987f28df0eaf3f47fc5833e17a803f7ba1b8c Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Tue, 24 Jun 2025 23:04:37 -0500 Subject: make frontend work with backend and wait until album response recieved before initializing albums page. extra checks around config --- static/src/connector.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'static/src/connector.js') diff --git a/static/src/connector.js b/static/src/connector.js index 5d8b62f..9568dc8 100644 --- a/static/src/connector.js +++ b/static/src/connector.js @@ -37,12 +37,12 @@ class APIConnector { }) .catch(error => { console.error("Fetch error:", error) + return null }) } async assetDownload(key) { const filename = await this.assetFileName(key) - console.log(filename) fetch(this.assetFullsizeSrc(key)) .then(response => { if (!response.ok) @@ -59,6 +59,7 @@ class APIConnector { }) .catch(error => { console.error("Fetch error:", error) + return null }) } @@ -87,5 +88,5 @@ class APIConnector { assetFileName(key) { return this.fetch(`/asset/${key}/filename`).then(d => d.filename) } } -const apiConnector = new APIConnector("http://localhost:5000") +const apiConnector = new APIConnector(window.location.origin) export default apiConnector -- cgit v1.2.3