diff options
author | 2018-02-06 13:54:21 +0100 | |
---|---|---|
committer | 2018-02-06 13:54:21 +0100 | |
commit | e82d7eeee58a6fd6d0b71788c4fd2f09ce90d8f5 (patch) | |
tree | df2ef10e36a909b8dceceaf8aca8ab72625713c8 /src/components/auth/Import.js | |
parent | [MINOR] isDevMode check in UserStore (diff) | |
download | ferdium-app-e82d7eeee58a6fd6d0b71788c4fd2f09ce90d8f5.tar.gz ferdium-app-e82d7eeee58a6fd6d0b71788c4fd2f09ce90d8f5.tar.zst ferdium-app-e82d7eeee58a6fd6d0b71788c4fd2f09ce90d8f5.zip |
FIX import screen toggles
- fix toggle double click event (nested `fields` property)
- do not call `prepareForm` for every render but only on init (otherwise all toggles reset to `default: true`
Diffstat (limited to 'src/components/auth/Import.js')
-rw-r--r-- | src/components/auth/Import.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/components/auth/Import.js b/src/components/auth/Import.js index 078244434..7de571896 100644 --- a/src/components/auth/Import.js +++ b/src/components/auth/Import.js | |||
@@ -41,22 +41,20 @@ export default class Import extends Component { | |||
41 | intl: intlShape, | 41 | intl: intlShape, |
42 | }; | 42 | }; |
43 | 43 | ||
44 | prepareForm() { | 44 | config = { |
45 | const { services } = this.props; | ||
46 | |||
47 | const config = { | ||
48 | fields: { | 45 | fields: { |
49 | import: [...services.filter(s => s.recipe).map(s => ({ | 46 | import: [...this.props.services.filter(s => s.recipe).map(s => ({ |
50 | add: { | 47 | fields: { |
51 | default: true, | 48 | add: { |
52 | options: s, | 49 | default: true, |
50 | options: s, | ||
51 | }, | ||
53 | }, | 52 | }, |
54 | }))], | 53 | }))], |
55 | }, | 54 | }, |
56 | }; | 55 | }; |
57 | 56 | ||
58 | return new Form(config, this.context.intl); | 57 | form = new Form(this.config, this.context.intl); |
59 | } | ||
60 | 58 | ||
61 | submit(e) { | 59 | submit(e) { |
62 | const { services } = this.props; | 60 | const { services } = this.props; |
@@ -74,7 +72,9 @@ export default class Import extends Component { | |||
74 | } | 72 | } |
75 | 73 | ||
76 | render() { | 74 | render() { |
77 | this.form = this.prepareForm(); | 75 | // if (this.form === undefined) { |
76 | // this.form = this.prepareForm(); | ||
77 | // } | ||
78 | const { intl } = this.context; | 78 | const { intl } = this.context; |
79 | const { services, isSubmitting, inviteRoute } = this.props; | 79 | const { services, isSubmitting, inviteRoute } = this.props; |
80 | 80 | ||