diff options
author | vantezzen <properly@protonmail.com> | 2019-08-26 21:25:59 +0200 |
---|---|---|
committer | vantezzen <properly@protonmail.com> | 2019-08-26 21:25:59 +0200 |
commit | 8ab680e9648adf342d3dbd42cd0ebe02e31a00a8 (patch) | |
tree | b419545dab6c2864641dd9ccc5d2188fb56c48b1 /src | |
parent | Lint (diff) | |
download | ferdium-app-8ab680e9648adf342d3dbd42cd0ebe02e31a00a8.tar.gz ferdium-app-8ab680e9648adf342d3dbd42cd0ebe02e31a00a8.tar.zst ferdium-app-8ab680e9648adf342d3dbd42cd0ebe02e31a00a8.zip |
Improve apibase function
Diffstat (limited to 'src')
-rw-r--r-- | src/api/apiBase.js | 9 | ||||
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/api/apiBase.js b/src/api/apiBase.js index ce02922ac..b40673e44 100644 --- a/src/api/apiBase.js +++ b/src/api/apiBase.js | |||
@@ -8,9 +8,11 @@ import { | |||
8 | 8 | ||
9 | const apiBase = () => { | 9 | const apiBase = () => { |
10 | let url; | 10 | let url; |
11 | |||
11 | if (!window.ferdi | 12 | if (!window.ferdi |
12 | || !window.ferdi.stores.settings | 13 | || !window.ferdi.stores.settings |
13 | || !window.ferdi.stores.settings.all) { | 14 | || !window.ferdi.stores.settings.all |
15 | || !window.ferdi.stores.settings.all.app.server) { | ||
14 | // Stores have not yet been loaded - send invalid URL to force a retry when stores are loaded | 16 | // Stores have not yet been loaded - send invalid URL to force a retry when stores are loaded |
15 | // "Why 1.1.1.1 as the default, invalid URL?" | 17 | // "Why 1.1.1.1 as the default, invalid URL?" |
16 | // 1.1.1.1 is the server for Cloudflare's DNS service and will be the same across most networks. | 18 | // 1.1.1.1 is the server for Cloudflare's DNS service and will be the same across most networks. |
@@ -20,12 +22,9 @@ const apiBase = () => { | |||
20 | // on some routes. This would result in Ferdi deleting its current authToken as it thinks it | 22 | // on some routes. This would result in Ferdi deleting its current authToken as it thinks it |
21 | // has gone invalid. | 23 | // has gone invalid. |
22 | url = 'https://1.1.1.1'; | 24 | url = 'https://1.1.1.1'; |
23 | } else if (window.ferdi.stores.settings.all.app.server) { | 25 | } else { |
24 | // Load URL from store | 26 | // Load URL from store |
25 | url = window.ferdi.stores.settings.all.app.server; | 27 | url = window.ferdi.stores.settings.all.app.server; |
26 | } else { | ||
27 | // Use default server url | ||
28 | url = API; | ||
29 | } | 28 | } |
30 | 29 | ||
31 | return `${url}/${API_VERSION}`; | 30 | return `${url}/${API_VERSION}`; |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index de324b115..6d2dd0572 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -254,6 +254,11 @@ export default @observer class EditSettingsForm extends Component { | |||
254 | <span className="mdi mdi-information" /> | 254 | <span className="mdi mdi-information" /> |
255 | {intl.formatMessage(messages.languageDisclaimer)} | 255 | {intl.formatMessage(messages.languageDisclaimer)} |
256 | </p> | 256 | </p> |
257 | <p className="settings__message"> | ||
258 | <span className="mdi mdi-github-face" /> | ||
259 | Ferdi is based on <a href="https://github.com/meetfranz/franz">Franz</a>, a project published | ||
260 | under the <a href="https://github.com/meetfranz/franz/blob/master/LICENSE">Apache-2.0 License</a> | ||
261 | </p> | ||
257 | </form> | 262 | </form> |
258 | </div> | 263 | </div> |
259 | </div> | 264 | </div> |