diff options
Diffstat (limited to 'src/components/settings/settings/EditSettingsForm.js')
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 9564d837b..5478ce8bf 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -18,15 +18,6 @@ const { | |||
18 | systemPreferences, | 18 | systemPreferences, |
19 | } = remote; | 19 | } = remote; |
20 | 20 | ||
21 | function escapeHtml(unsafe) { | ||
22 | return unsafe | ||
23 | .replace(/&/g, '&') | ||
24 | .replace(/</g, '<') | ||
25 | .replace(/>/g, '>') | ||
26 | .replace(/"/g, '"') | ||
27 | .replace(/'/g, '''); | ||
28 | } | ||
29 | |||
30 | const messages = defineMessages({ | 21 | const messages = defineMessages({ |
31 | headline: { | 22 | headline: { |
32 | id: 'settings.app.headline', | 23 | id: 'settings.app.headline', |
@@ -48,14 +39,6 @@ const messages = defineMessages({ | |||
48 | id: 'settings.app.inactivityLockInfo', | 39 | id: 'settings.app.inactivityLockInfo', |
49 | defaultMessage: '!!!Minutes of inactivity, after which Ferdi should automatically lock. Use 0 to disable', | 40 | defaultMessage: '!!!Minutes of inactivity, after which Ferdi should automatically lock. Use 0 to disable', |
50 | }, | 41 | }, |
51 | serverInfo: { | ||
52 | id: 'settings.app.serverInfo', | ||
53 | defaultMessage: '!!!We advice you to logout after changing your server as your settings might not be saved otherwise.', | ||
54 | }, | ||
55 | serverMoneyInfo: { | ||
56 | id: 'settings.app.serverMoneyInfo', | ||
57 | defaultMessage: '!!!You are using the official Franz Server for Ferdi.\nWe know that Ferdi allows you to use all its features for free but you are still using Franz\'s server resources - which Franz\'s creator has to pay for.\nPlease still consider [Link 1]paying for a Franz account[/Link] or [Link 2]using a self-hosted ferdi-server[/Link] (if you have the knowledge and resources to do so). \nBy using Ferdi, you still profit greatly from Franz\'s recipe store, server resources and its development.', | ||
58 | }, | ||
59 | todoServerInfo: { | 42 | todoServerInfo: { |
60 | id: 'settings.app.todoServerInfo', | 43 | id: 'settings.app.todoServerInfo', |
61 | defaultMessage: '!!!This server will be used for the "Franz Todo" feature. (default: https://app.franztodos.com)', | 44 | defaultMessage: '!!!This server will be used for the "Franz Todo" feature. (default: https://app.franztodos.com)', |
@@ -174,7 +157,6 @@ export default @observer class EditSettingsForm extends Component { | |||
174 | isSpellcheckerIncludedInCurrentPlan: PropTypes.bool.isRequired, | 157 | isSpellcheckerIncludedInCurrentPlan: PropTypes.bool.isRequired, |
175 | isTodosEnabled: PropTypes.bool.isRequired, | 158 | isTodosEnabled: PropTypes.bool.isRequired, |
176 | isWorkspaceEnabled: PropTypes.bool.isRequired, | 159 | isWorkspaceEnabled: PropTypes.bool.isRequired, |
177 | server: PropTypes.string.isRequired, | ||
178 | noUpdates: PropTypes.bool.isRequired, | 160 | noUpdates: PropTypes.bool.isRequired, |
179 | hibernationEnabled: PropTypes.bool.isRequired, | 161 | hibernationEnabled: PropTypes.bool.isRequired, |
180 | isDarkmodeEnabled: PropTypes.bool.isRequired, | 162 | isDarkmodeEnabled: PropTypes.bool.isRequired, |
@@ -214,7 +196,6 @@ export default @observer class EditSettingsForm extends Component { | |||
214 | isSpellcheckerIncludedInCurrentPlan, | 196 | isSpellcheckerIncludedInCurrentPlan, |
215 | isTodosEnabled, | 197 | isTodosEnabled, |
216 | isWorkspaceEnabled, | 198 | isWorkspaceEnabled, |
217 | server, | ||
218 | noUpdates, | 199 | noUpdates, |
219 | hibernationEnabled, | 200 | hibernationEnabled, |
220 | isDarkmodeEnabled, | 201 | isDarkmodeEnabled, |
@@ -232,8 +213,6 @@ export default @observer class EditSettingsForm extends Component { | |||
232 | updateButtonLabelMessage = messages.buttonSearchForUpdate; | 213 | updateButtonLabelMessage = messages.buttonSearchForUpdate; |
233 | } | 214 | } |
234 | 215 | ||
235 | const isLoggedIn = Boolean(localStorage.getItem('authToken')); | ||
236 | |||
237 | const { | 216 | const { |
238 | lockingFeatureEnabled, | 217 | lockingFeatureEnabled, |
239 | scheduledDNDEnabled, | 218 | scheduledDNDEnabled, |
@@ -287,53 +266,10 @@ export default @observer class EditSettingsForm extends Component { | |||
287 | 266 | ||
288 | <Hr /> | 267 | <Hr /> |
289 | 268 | ||
290 | <Input | ||
291 | placeholder="Server" | ||
292 | onChange={e => this.submit(e)} | ||
293 | field={form.$('server')} | ||
294 | autoFocus | ||
295 | /> | ||
296 | {isLoggedIn && ( | ||
297 | <p | ||
298 | className="settings__message" | ||
299 | style={{ | ||
300 | borderTop: 0, marginTop: 0, paddingTop: 0, marginBottom: '2rem', | ||
301 | }} | ||
302 | > | ||
303 | { intl.formatMessage(messages.serverInfo) } | ||
304 | </p> | ||
305 | )} | ||
306 | {server === 'https://api.franzinfra.com' && ( | ||
307 | <p | ||
308 | className="settings__message" | ||
309 | style={{ | ||
310 | borderTop: 0, marginTop: 0, paddingTop: 0, marginBottom: '2rem', | ||
311 | }} | ||
312 | > | ||
313 | <span | ||
314 | dangerouslySetInnerHTML={{ | ||
315 | __html: | ||
316 | // Needed to make links work | ||
317 | escapeHtml( | ||
318 | intl.formatMessage(messages.serverMoneyInfo), | ||
319 | ).replace('[Link 1]', '<a href="https://www.meetfranz.com/pricing" target="_blank">') | ||
320 | .replace('[Link 2]', '<a href="https://github.com/getferdi/server" target="_blank">') | ||
321 | .replace(/\[\/Link]/g, '</a>'), | ||
322 | }} | ||
323 | style={{ | ||
324 | whiteSpace: 'pre-wrap', | ||
325 | }} | ||
326 | /> | ||
327 | </p> | ||
328 | )} | ||
329 | |||
330 | <Hr /> | ||
331 | |||
332 | {isWorkspaceEnabled && ( | 269 | {isWorkspaceEnabled && ( |
333 | <Toggle field={form.$('keepAllWorkspacesLoaded')} /> | 270 | <Toggle field={form.$('keepAllWorkspacesLoaded')} /> |
334 | )} | 271 | )} |
335 | 272 | ||
336 | |||
337 | <Hr /> | 273 | <Hr /> |
338 | 274 | ||
339 | {isTodosEnabled && ( | 275 | {isTodosEnabled && ( |