Skip to content

Commit f8de081

Browse files
committed
add event listeners to fix this strange modal flow
1 parent 76b9ba5 commit f8de081

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

packages/desktop-gui/src/runs/project-not-setup.jsx

+17
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import BootstrapModal from 'react-bootstrap-modal'
66
import ipc from '../lib/ipc'
77
import { configFileFormatted } from '../lib/config-file-formatted'
88
import SetupProject from './setup-project-modal'
9+
import authStore from '../auth/auth-store'
910

1011
@observer
1112
export default class ProjectNotSetup extends Component {
@@ -92,6 +93,22 @@ export default class ProjectNotSetup extends Component {
9293
_projectSetup () {
9394
if (!this.state.setupProjectModalOpen) return null
9495

96+
if (!this.props.isAuthenticated) {
97+
authStore.openLogin((isAuthenticated) => {
98+
if (!isAuthenticated) {
99+
// auth was canceled, cancel project setup too
100+
this.setState({ setupProjectModalOpen: false })
101+
}
102+
})
103+
104+
return null
105+
}
106+
107+
if (this.props.isShowingLogin) {
108+
// login dialog still open, wait for it to close before proceeding
109+
return null
110+
}
111+
95112
return (
96113
<SetupProject
97114
project={this.props.project}

packages/desktop-gui/src/runs/runs-list.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ class RunsList extends Component {
290290
_projectNotSetup (isValid = true) {
291291
return (
292292
<ProjectNotSetup
293+
isAuthenticated={authStore.isAuthenticated}
294+
isShowingLogin={authStore.isShowingLogin}
293295
project={this.props.project}
294296
isValid={isValid}
295297
onSetup={this._setProjectDetails}

0 commit comments

Comments
 (0)