diff --git a/src/components/farm/Board.jsx b/src/components/farm/Board.jsx
index 4f7a5e0..3f5ce79 100644
--- a/src/components/farm/Board.jsx
+++ b/src/components/farm/Board.jsx
@@ -1232,17 +1232,19 @@ class Action extends React.Component {
}
}
return (
-
-
-
- {view}
-
-
-
- {this.props.otherPlayersTurn ? () : buttons}
-
-
-
+
this.props.forwardRef(x)}>
+
+
+
+ {view}
+
+
+
+ {this.props.otherPlayersTurn ? () : buttons}
+
+
+
+
);
}
}
@@ -1447,6 +1449,13 @@ class BoardApp extends React.Component {
card: props.ui.card
};
this.myRef = React.createRef();
+ this.actionRef = React.createRef();
+ this.actionRefExtra = React.createRef();
+ }
+
+ actionShowing = () => {
+ return (this.actionRef && this.actionRef.offsetParent) ||
+ (this.actionRefExtra && this.actionRefExtra.offsetParent)
}
showScreen = screen => {
@@ -1475,7 +1484,7 @@ class BoardApp extends React.Component {
// it as handled.
if (this.props.ui.unhandledAlert &&
this.props.ui.unhandledAlert.type === ALERTS.beginTurn &&
- this.state.screen === SCREENS.action) {
+ this.actionShowing()) {
this.props.alertHandled(this.props.ui.unhandledAlert.id);
}
}
@@ -1567,7 +1576,7 @@ class BoardApp extends React.Component {
);
- } else if (alert && this.state.screen !== SCREENS.action) {
+ } else if (alert && !this.actionShowing()) {
switch (alert.type) {
case ALERTS.beginTurn:
alertOverlay = (
@@ -1651,6 +1660,7 @@ class BoardApp extends React.Component {
this.actionRef = x}
spaces={this.props.spaces}
player={this.props.player}
game={this.props.game}
@@ -1699,6 +1709,7 @@ class BoardApp extends React.Component {
this.actionRefExtra = x}
spaces={this.props.spaces}
player={this.props.player}
game={this.props.game}