peers gone...

This commit is contained in:
2025-11-14 02:16:53 +01:00
parent fe7444be4f
commit 2952b596e2
3 changed files with 181 additions and 45 deletions
@@ -136,6 +136,31 @@ const App = () => {
return unlisten;
};
const setupPeersGoneListener = async () => {
const unlisten = await listen('game-download-peers-gone', (event) => {
const game_id = event.payload as string;
console.log(`❌ game-download-peers-gone ${game_id} event received`);
clearCheckingPeersTimeout(game_id);
setGameItems(prev => prev.map(item => item.id === game_id
? {
...item,
install_status: item.installed ? InstallStatus.Installed : InstallStatus.NotInstalled,
status_message: 'Failed: All Peers gone',
status_level: 'error',
}
: item));
const pathString = String(gameDir);
if (!pathString) {
console.error('gameDir is empty before invoke!');
return;
}
invoke('update_game_directory', { path: pathString })
.catch(error => console.error('❌ Error updating game directory:', error));
});
return unlisten;
};
const setupNoPeersListener = async () => {
const unlisten = await listen('game-no-peers', (event) => {
const game_id = event.payload as string;
@@ -154,6 +179,7 @@ const App = () => {
};
setupDownloadFailedListener();
setupPeersGoneListener();
setupNoPeersListener();
const setupPeerCountListener = async () => {