possibly fixed auto updater? hid buttons untill shown and made the yes/no actually respond to something

This commit is contained in:
2026-09-21 19:22:18 -07:00
parent 99e45fd7ff
commit 33727a79c5
2 changed files with 7 additions and 7 deletions

12
main.js
View File

@@ -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 }); sendToTauri('tauri-cmd', { cmd: req.params.cmd, url: req.query.url, window: req.query.window });
res.sendStatus(200); 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.resume();
process.stdin.on('end', () => { process.stdin.on('end', () => {
@@ -350,8 +350,8 @@ async function start() {
tempApp.get('/update/info', (req, res) => { tempApp.get('/update/info', (req, res) => {
res.json({ available: true, current: localVersion, latest: release.version }); res.json({ available: true, current: localVersion, latest: release.version });
}); });
const handleYes = (req, res) => { userDecision = true; res.sendStatus(200); }; const handleYes = (req, res) => { debugLog("tempApp received YES"); userDecision = true; res.sendStatus(200); };
const handleNo = (req, res) => { userDecision = false; res.sendStatus(200); }; const handleNo = (req, res) => { debugLog("tempApp received NO"); userDecision = false; res.sendStatus(200); };
tempApp.all('/update/yes', handleYes); tempApp.all('/update/yes', handleYes);
tempApp.all('/update/install', handleYes); tempApp.all('/update/install', handleYes);
@@ -365,7 +365,7 @@ async function start() {
}); });
const tempServer = await new Promise((resolve) => { 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) => { s.on('error', (err) => {
debugLog(`Update server bind error: ${err.message}`); debugLog(`Update server bind error: ${err.message}`);
resolve(null); resolve(null);
@@ -480,10 +480,10 @@ async function start() {
const FRONTEND_PORT = 4890; const FRONTEND_PORT = 4890;
expressApp.use('/build', express.static(path.join(__dirname, 'build'))); 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.' }); sendToTauri('status', { message: 'All backend services running and healthy.' });
debugLog("Frontend Express running on 4890. Sending READY to Tauri."); 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) { } catch (error) {

View File

@@ -448,7 +448,7 @@ const LINK_HANDLER_SCRIPT: &str =
logoBtn.onclick = (e) => { logoBtn.onclick = (e) => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
window.location.href = 'http://localhost:4890'; window.location.href = 'http://127.0.0.1:4890';
}; };
} }