Skip to content

Commit

Permalink
don't need to keep prompt open for peers (just host)
Browse files Browse the repository at this point in the history
  • Loading branch information
lesleyrs committed Jul 31, 2024
1 parent dedeb5f commit b6c00e1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/js/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,13 @@ export abstract class Client extends GameShell {
return;
}

let offer: string | null;
try {
while ((offer = prompt('Paste offer here, answer will be copied to clipboard')) === null);
await this.peer.handleOffer(offer);
} catch (e) {
console.error(e);
const offer: string | null = prompt('Paste offer here, answer will be copied to clipboard');
if (offer) {
try {
await this.peer.handleOffer(offer);
} catch (e) {
console.error(e);
}
}
}
}
Expand Down

0 comments on commit b6c00e1

Please sign in to comment.