copilot feedback addressed

This commit is contained in:
Michael Neale
2025-11-06 15:42:31 +11:00
parent f4a3b5948b
commit e9ca916b71
3 changed files with 9 additions and 5 deletions
+2 -4
View File
@@ -145,14 +145,12 @@ impl TunnelManager {
}
fn generate_secret() -> String {
let mut rng = rand::rng();
let bytes: Vec<u8> = (0..32).map(|_| rand::Rng::random(&mut rng)).collect();
let bytes: [u8; 32] = rand::random();
hex::encode(bytes)
}
fn generate_agent_id() -> String {
let mut rng = rand::rng();
let bytes: Vec<u8> = (0..16).map(|_| rand::Rng::random(&mut rng)).collect();
let bytes: [u8; 16] = rand::random();
hex::encode(bytes)
}
@@ -54,6 +54,12 @@ export default function TunnelSection() {
setShowQRModal(false);
} catch (err) {
setError(errorMessage(err, 'Failed to stop tunnel'));
try {
const status = await window.electron.getTunnelStatus();
setTunnelStatus(status);
} catch (statusErr) {
console.error('Failed to fetch tunnel status after error:', statusErr);
}
}
};
+1 -1
View File
@@ -1282,7 +1282,7 @@ ipcMain.handle('get-tunnel-status', async () => {
return await syncTunnelStatus(globalGoosedPort, SERVER_SECRET);
} catch (error) {
console.error('Error getting tunnel status:', error);
return { state: 'error', info: null };
return { state: 'error', info: null, auto_start: false };
}
});