diff options
author | 2021-08-05 08:58:28 +0200 | |
---|---|---|
committer | 2021-08-05 08:05:49 +0000 | |
commit | 305c2c5ecb49a1349be2efb1ef557d61da9a64dc (patch) | |
tree | 19a05ed4ddfc1e5b5bb7fc3ecc071ad562da820f /src/containers/auth | |
parent | refactor: minor refactoring: solve name-clash of env vars vs vars in the program (diff) | |
download | ferdium-app-305c2c5ecb49a1349be2efb1ef557d61da9a64dc.tar.gz ferdium-app-305c2c5ecb49a1349be2efb1ef557d61da9a64dc.tar.zst ferdium-app-305c2c5ecb49a1349be2efb1ef557d61da9a64dc.zip |
refactor: general code improvements
- replace deprecated fs.exists with fs.existsSync
- replace console.log with debug
- replace hardcoded FERDI_VERSION in start.js with dynamic one from package.json
- correct JSDoc annotations in Handler.js
- simplify macOSPermissions.js
- updates to various eslint rules
- add FileReader to known globals
Diffstat (limited to 'src/containers/auth')
-rw-r--r-- | src/containers/auth/SetupAssistantScreen.js | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/containers/auth/SetupAssistantScreen.js b/src/containers/auth/SetupAssistantScreen.js index d14085f63..d7036969a 100644 --- a/src/containers/auth/SetupAssistantScreen.js +++ b/src/containers/auth/SetupAssistantScreen.js | |||
@@ -4,14 +4,27 @@ import PropTypes from 'prop-types'; | |||
4 | import { inject, observer } from 'mobx-react'; | 4 | import { inject, observer } from 'mobx-react'; |
5 | 5 | ||
6 | import { RouterStore } from 'mobx-react-router'; | 6 | import { RouterStore } from 'mobx-react-router'; |
7 | import { DEFAULT_TODO_RECIPE_ID, DEFAULT_TODO_SERVICE_NAME } from '../../config'; | 7 | import { |
8 | DEFAULT_TODO_RECIPE_ID, | ||
9 | DEFAULT_TODO_SERVICE_NAME, | ||
10 | } from '../../config'; | ||
8 | import { sleep } from '../../helpers/async-helpers'; | 11 | import { sleep } from '../../helpers/async-helpers'; |
9 | import SetupAssistant from '../../components/auth/SetupAssistant'; | 12 | import SetupAssistant from '../../components/auth/SetupAssistant'; |
10 | import ServicesStore from '../../stores/ServicesStore'; | 13 | import ServicesStore from '../../stores/ServicesStore'; |
11 | import RecipesStore from '../../stores/RecipesStore'; | 14 | import RecipesStore from '../../stores/RecipesStore'; |
12 | import UserStore from '../../stores/UserStore'; | 15 | import UserStore from '../../stores/UserStore'; |
13 | 16 | ||
14 | export default @inject('stores', 'actions') @observer class SetupAssistantScreen extends Component { | 17 | export default |
18 | @inject('stores', 'actions') | ||
19 | @observer | ||
20 | class SetupAssistantScreen extends Component { | ||
21 | constructor(props) { | ||
22 | super(props); | ||
23 | this.state = { | ||
24 | isSettingUpServices: false, | ||
25 | }; | ||
26 | } | ||
27 | |||
15 | // TODO: Why are these hardcoded here? Do they need to conform to specific services in the packaged recipes? If so, its more important to fix this | 28 | // TODO: Why are these hardcoded here? Do they need to conform to specific services in the packaged recipes? If so, its more important to fix this |
16 | services = { | 29 | services = { |
17 | whatsapp: { | 30 | whatsapp: { |
@@ -50,15 +63,12 @@ export default @inject('stores', 'actions') @observer class SetupAssistantScreen | |||
50 | name: 'LinkedIn', | 63 | name: 'LinkedIn', |
51 | hasTeamId: false, | 64 | hasTeamId: false, |
52 | }, | 65 | }, |
53 | } | 66 | }; |
54 | |||
55 | state = { | ||
56 | isSettingUpServices: false, | ||
57 | } | ||
58 | 67 | ||
59 | async setupServices(serviceConfig) { | 68 | async setupServices(serviceConfig) { |
60 | const { stores: { services } } = this.props; | 69 | const { |
61 | console.log(serviceConfig); | 70 | stores: { services }, |
71 | } = this.props; | ||
62 | 72 | ||
63 | this.setState({ | 73 | this.setState({ |
64 | isSettingUpServices: true, | 74 | isSettingUpServices: true, |
@@ -102,7 +112,7 @@ export default @inject('stores', 'actions') @observer class SetupAssistantScreen | |||
102 | render() { | 112 | render() { |
103 | return ( | 113 | return ( |
104 | <SetupAssistant | 114 | <SetupAssistant |
105 | onSubmit={(config) => this.setupServices(config)} | 115 | onSubmit={config => this.setupServices(config)} |
106 | services={this.services} | 116 | services={this.services} |
107 | embed={false} | 117 | embed={false} |
108 | isSettingUpServices={this.state.isSettingUpServices} | 118 | isSettingUpServices={this.state.isSettingUpServices} |