diff options
author | 2022-05-14 14:51:08 -0500 | |
---|---|---|
committer | 2022-05-14 14:51:08 -0500 | |
commit | 85cb50a20b8f3d7b0c3599fe6baa1d3e3040f0ae (patch) | |
tree | 201f63fd866b1a3e301699661a9383f53a43e65e /src/components/auth/ChangeServer.js | |
parent | Added TODOs for tech debt (diff) | |
download | ferdium-app-85cb50a20b8f3d7b0c3599fe6baa1d3e3040f0ae.tar.gz ferdium-app-85cb50a20b8f3d7b0c3599fe6baa1d3e3040f0ae.tar.zst ferdium-app-85cb50a20b8f3d7b0c3599fe6baa1d3e3040f0ae.zip |
Minor refactoring for aligning on usage of 'intl' package
Diffstat (limited to 'src/components/auth/ChangeServer.js')
-rw-r--r-- | src/components/auth/ChangeServer.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/components/auth/ChangeServer.js b/src/components/auth/ChangeServer.js index aa4598928..a7aa33ab1 100644 --- a/src/components/auth/ChangeServer.js +++ b/src/components/auth/ChangeServer.js | |||
@@ -50,11 +50,12 @@ class ChangeServer extends Component { | |||
50 | 50 | ||
51 | defaultServers = [this.ferdiumServer, this.franzServer, this.ferdiServer]; | 51 | defaultServers = [this.ferdiumServer, this.franzServer, this.ferdiServer]; |
52 | 52 | ||
53 | form = new Form( | 53 | form = (() => { |
54 | { | 54 | const { intl } = this.props; |
55 | return new Form({ | ||
55 | fields: { | 56 | fields: { |
56 | server: { | 57 | server: { |
57 | label: this.props.intl.formatMessage(messages.label), | 58 | label: intl.formatMessage(messages.label), |
58 | value: this.props.server, | 59 | value: this.props.server, |
59 | options: [ | 60 | options: [ |
60 | { value: this.ferdiumServer, label: 'Ferdium (Default)' }, | 61 | { value: this.ferdiumServer, label: 'Ferdium (Default)' }, |
@@ -69,14 +70,15 @@ class ChangeServer extends Component { | |||
69 | ], | 70 | ], |
70 | }, | 71 | }, |
71 | customServer: { | 72 | customServer: { |
72 | label: this.props.intl.formatMessage(messages.customServerLabel), | 73 | label: intl.formatMessage(messages.customServerLabel), |
73 | value: '', | 74 | value: '', |
74 | validators: [url, required], | 75 | validators: [url, required], |
75 | }, | 76 | }, |
76 | }, | 77 | }, |
77 | }, | 78 | }, |
78 | this.props.intl, | 79 | intl, |
79 | ); | 80 | ); |
81 | })(); | ||
80 | 82 | ||
81 | componentDidMount() { | 83 | componentDidMount() { |
82 | if (this.defaultServers.includes(this.props.server)) { | 84 | if (this.defaultServers.includes(this.props.server)) { |