Skip to content

Commit

Permalink
Alter dialog flow for AI reconnect (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Terkwood authored Nov 9, 2020
1 parent 54b98dd commit 5375d4c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# NEXT: v1.0.2
# v1.0.2

- Fix spammy dialog during reconnection to AI play #450, #238
- Update webpack dep in browser #451

# v1.0.1
Expand Down
2 changes: 1 addition & 1 deletion browser/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bugout-browser",
"productName": "BUGOUT",
"version": "1.0.2-a",
"version": "1.0.2",
"description": "Graphical user interface for BUGOUT Go/Baduk/Weiqi",
"author": "Terkwood <38859656+Terkwood@users.noreply.github.com>",
"homepage": "https://github.com/Terkwood/BUGOUT",
Expand Down
2 changes: 1 addition & 1 deletion browser/src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const EDITION = "Source";
const EDITION = "Speechless";

const EventEmitter = require("events");
const { ipcRenderer, remote } = require("electron");
Expand Down
15 changes: 8 additions & 7 deletions browser/src/components/bugout/MultiplayerColorPrefModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,21 @@ class MultiplayerColorPrefModal extends Component {

let { entryMethod, boardSize } = data;

let turnOn =
let isPrivateEntryWithBoardSizeDefined =
entryMethod && entryMethod == EntryMethod.CREATE_PRIVATE
? boardSize !== undefined
: true;

let isBotEntry = entryMethod && entryMethod == EntryMethod.PLAY_BOT;

let { showDialog, turnedOnOnce } = this.state;

let happyTimes = (turnOn && !turnedOnOnce) || showDialog;
let turnOn =
!isBotEntry &&
((isPrivateEntryWithBoardSizeDefined && !turnedOnOnce) || showDialog) &&
idleStatus;

if (
!happyTimes ||
idleStatus == undefined ||
idleStatus !== IdleStatus.ONLINE
) {
if (!turnOn) {
return h("div", { id });
}

Expand Down

0 comments on commit 5375d4c

Please sign in to comment.