diff options
author | vantezzen <hello@vantezzen.io> | 2020-02-11 14:10:49 +0100 |
---|---|---|
committer | vantezzen <hello@vantezzen.io> | 2020-02-11 14:10:49 +0100 |
commit | c916137cec8bddda44ef35351b60d458fe781ec9 (patch) | |
tree | 4ebc41ae17e753705e7408c83252188c9660dadd /src | |
parent | Fix lint (diff) | |
parent | Merge pull request #361 from getferdi/all-contributors/add-dpeukert (diff) | |
download | ferdium-app-c916137cec8bddda44ef35351b60d458fe781ec9.tar.gz ferdium-app-c916137cec8bddda44ef35351b60d458fe781ec9.tar.zst ferdium-app-c916137cec8bddda44ef35351b60d458fe781ec9.zip |
Merge branch 'develop' of https://github.com/getferdi/ferdi into develop
Diffstat (limited to 'src')
-rw-r--r-- | src/components/settings/services/EditServiceForm.js | 2 | ||||
-rw-r--r-- | src/models/Service.js | 6 | ||||
-rw-r--r-- | src/stores/SettingsStore.js | 8 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index fa34ac60b..89c82c7f8 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js | |||
@@ -169,7 +169,7 @@ export default @observer class EditServiceForm extends Component { | |||
169 | if (recipe.validateUrl && values.customUrl) { | 169 | if (recipe.validateUrl && values.customUrl) { |
170 | this.setState({ isValidatingCustomUrl: true }); | 170 | this.setState({ isValidatingCustomUrl: true }); |
171 | try { | 171 | try { |
172 | values.customUrl = normalizeUrl(values.customUrl, { stripWWW: false }); | 172 | values.customUrl = normalizeUrl(values.customUrl, { stripWWW: false, removeTrailingSlash: false }); |
173 | isValid = await recipe.validateUrl(values.customUrl); | 173 | isValid = await recipe.validateUrl(values.customUrl); |
174 | } catch (err) { | 174 | } catch (err) { |
175 | console.warn('ValidateURL', err); | 175 | console.warn('ValidateURL', err); |
diff --git a/src/models/Service.js b/src/models/Service.js index 10b54602f..12a2d4af9 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -1,6 +1,6 @@ | |||
1 | import { computed, observable, autorun } from 'mobx'; | 1 | import { autorun, computed, observable } from 'mobx'; |
2 | import path from 'path'; | ||
3 | import normalizeUrl from 'normalize-url'; | 2 | import normalizeUrl from 'normalize-url'; |
3 | import path from 'path'; | ||
4 | 4 | ||
5 | const debug = require('debug')('Ferdi:Service'); | 5 | const debug = require('debug')('Ferdi:Service'); |
6 | 6 | ||
@@ -146,7 +146,7 @@ export default class Service { | |||
146 | if (this.recipe.hasCustomUrl && this.customUrl) { | 146 | if (this.recipe.hasCustomUrl && this.customUrl) { |
147 | let url; | 147 | let url; |
148 | try { | 148 | try { |
149 | url = normalizeUrl(this.customUrl, { stripWWW: false }); | 149 | url = normalizeUrl(this.customUrl, { stripWWW: false, removeTrailingSlash: false }); |
150 | } catch (err) { | 150 | } catch (err) { |
151 | console.error(`Service (${this.recipe.name}): '${this.customUrl}' is not a valid Url.`); | 151 | console.error(`Service (${this.recipe.name}): '${this.customUrl}' is not a valid Url.`); |
152 | } | 152 | } |
diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index 8a5ee7204..428b6342c 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js | |||
@@ -47,9 +47,11 @@ export default class SettingsStore extends Store { | |||
47 | 47 | ||
48 | reaction( | 48 | reaction( |
49 | () => this.all.app.autohideMenuBar, | 49 | () => this.all.app.autohideMenuBar, |
50 | () => remote.getCurrentWindow().setAutoHideMenuBar( | 50 | () => { |
51 | this.all.app.autohideMenuBar, | 51 | const currentWindow = remote.getCurrentWindow(); |
52 | ), | 52 | currentWindow.setMenuBarVisibility(!this.all.app.autohideMenuBar); |
53 | currentWindow.setAutoHideMenuBar(this.all.app.autohideMenuBar); | ||
54 | }, | ||
53 | ); | 55 | ); |
54 | 56 | ||
55 | reaction( | 57 | reaction( |