mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-13 05:37:21 -05:00
possibly fixed auto updater? hid buttons untill shown and made the yes/no actually respond to something
This commit is contained in:
12
main.js
12
main.js
@@ -103,7 +103,7 @@ cmdApp.get('/__tauri_cmd/:cmd', (req, res) => {
|
||||
sendToTauri('tauri-cmd', { cmd: req.params.cmd, url: req.query.url, window: req.query.window });
|
||||
res.sendStatus(200);
|
||||
});
|
||||
cmdApp.listen(4892, () => debugLog("[CMD-SERVER] Dedicated command server listening on port 4892"));
|
||||
cmdApp.listen(4892, '127.0.0.1', () => debugLog("[CMD-SERVER] Dedicated command server listening on port 4892"));
|
||||
|
||||
process.stdin.resume();
|
||||
process.stdin.on('end', () => {
|
||||
@@ -350,8 +350,8 @@ async function start() {
|
||||
tempApp.get('/update/info', (req, res) => {
|
||||
res.json({ available: true, current: localVersion, latest: release.version });
|
||||
});
|
||||
const handleYes = (req, res) => { userDecision = true; res.sendStatus(200); };
|
||||
const handleNo = (req, res) => { userDecision = false; res.sendStatus(200); };
|
||||
const handleYes = (req, res) => { debugLog("tempApp received YES"); userDecision = true; res.sendStatus(200); };
|
||||
const handleNo = (req, res) => { debugLog("tempApp received NO"); userDecision = false; res.sendStatus(200); };
|
||||
|
||||
tempApp.all('/update/yes', handleYes);
|
||||
tempApp.all('/update/install', handleYes);
|
||||
@@ -365,7 +365,7 @@ async function start() {
|
||||
});
|
||||
|
||||
const tempServer = await new Promise((resolve) => {
|
||||
const s = tempApp.listen(4891, () => resolve(s));
|
||||
const s = tempApp.listen(4891, '127.0.0.1', () => resolve(s));
|
||||
s.on('error', (err) => {
|
||||
debugLog(`Update server bind error: ${err.message}`);
|
||||
resolve(null);
|
||||
@@ -480,10 +480,10 @@ async function start() {
|
||||
const FRONTEND_PORT = 4890;
|
||||
expressApp.use('/build', express.static(path.join(__dirname, 'build')));
|
||||
|
||||
expressServer = expressApp.listen(FRONTEND_PORT, () => {
|
||||
expressServer = expressApp.listen(FRONTEND_PORT, '127.0.0.1', () => {
|
||||
sendToTauri('status', { message: 'All backend services running and healthy.' });
|
||||
debugLog("Frontend Express running on 4890. Sending READY to Tauri.");
|
||||
sendToTauri('ready', { url: `http://localhost:${FRONTEND_PORT}` });
|
||||
sendToTauri('ready', { url: `http://127.0.0.1:${FRONTEND_PORT}` });
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
|
||||
@@ -448,7 +448,7 @@ const LINK_HANDLER_SCRIPT: &str =
|
||||
logoBtn.onclick = (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
window.location.href = 'http://localhost:4890';
|
||||
window.location.href = 'http://127.0.0.1:4890';
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user