fix(modal): preventing accidental close of startup modal

This commit is contained in:
Chris Troutner
2022-09-29 14:52:48 -07:00
parent fbe953d8d7
commit 40ee5c6cff
3 changed files with 131 additions and 486 deletions
+109 -483
View File
File diff suppressed because it is too large Load Diff
+12 -2
View File
@@ -115,7 +115,12 @@ class App extends React.Component {
{
this.state.showStartModal
? <UninitializedView modalBody={this.state.modalBody} hideSpinner={this.state.hideSpinner} appData={appData} />
? <UninitializedView
modalBody={this.state.modalBody}
hideSpinner={this.state.hideSpinner}
appData={appData}
denyClose={this.state.showStartModal}
/>
: <InitializedView wallet={this.state.wallet} menuState={this.state.menuState} appData={appData} />
}
@@ -156,7 +161,12 @@ function UninitializedView (props) {
return (
<>
<WaitingModal heading={heading} body={props.modalBody} hideSpinner={props.hideSpinner} />
<WaitingModal
heading={heading}
body={props.modalBody}
hideSpinner={props.hideSpinner}
denyClose={props.denyClose}
/>
{
_this.state.asyncInitFinished
+10 -1
View File
@@ -11,7 +11,16 @@ import { Container, Row, Col, Modal, Spinner } from 'react-bootstrap'
function ModalTemplate (props) {
const [show, setShow] = useState(true)
const handleClose = () => setShow(false)
const handleClose = () => {
console.log(`props.denyClose: ${props.denyClose}`)
if (props.denyClose) return
setShow(false)
if (props.closeFunc) {
props.closeFunc()
}
}
// const handleShow = () => setShow(true)
return (