diff --git a/public/album_art.html b/public/album_art.html
index df02b08..f7500c9 100644
--- a/public/album_art.html
+++ b/public/album_art.html
@@ -27,7 +27,7 @@
}
const setupWebSocket = (elements) => {
- const socket = new WebSocket('ws://10.0.0.162:3000');
+ const socket = new WebSocket('ws://WEBSOCKET_IP:3000');
socket.addEventListener('message', (event) => {
const trackDetails = JSON.parse(event.data);
diff --git a/src/index.js b/src/index.js
index ae7fc34..6dc736b 100644
--- a/src/index.js
+++ b/src/index.js
@@ -54,14 +54,14 @@ app.on("ready", async () => {
const destCssPath = join(userDataPath, 'tailwind.css');
try {
- const localIP = getLocalIP();
- let data = await fs.promises.readFile(sourceHtmlPath, 'utf8');
- data = data.replace('WEBSOCKET_IP', localIP);
- await fs.promises.writeFile(sourceHtmlPath, data, 'utf8');
await Promise.all([
copy(sourceCssPath, destCssPath),
copy(sourceHtmlPath, destHtmlPath),
]);
+ const localIP = getLocalIP();
+ let data = await fs.promises.readFile(destHtmlPath, 'utf8');
+ data = data.replace('WEBSOCKET_IP', localIP);
+ await fs.promises.writeFile(destHtmlPath, data, 'utf8');
} catch(err) {
console.error(`Error occurred during file copy: ${err}`);
}