diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/api/server/ServerApi.js | 5 | ||||
-rw-r--r-- | src/environment.js | 5 | ||||
-rw-r--r-- | src/helpers/userAgent-helpers.js | 16 | ||||
-rw-r--r-- | src/i18n/locales/defaultMessages.json | 28 | ||||
-rw-r--r-- | src/lib/TouchBar.js | 5 | ||||
-rw-r--r-- | src/stores/AppStore.js | 5 |
6 files changed, 32 insertions, 32 deletions
diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js index 24d095556..c63aa7dda 100644 --- a/src/api/server/ServerApi.js +++ b/src/api/server/ServerApi.js | |||
@@ -1,4 +1,3 @@ | |||
1 | import os from 'os'; | ||
2 | import path from 'path'; | 1 | import path from 'path'; |
3 | import tar from 'tar'; | 2 | import tar from 'tar'; |
4 | import fs from 'fs-extra'; | 3 | import fs from 'fs-extra'; |
@@ -15,7 +14,7 @@ import OrderModel from '../../models/Order'; | |||
15 | import { sleep } from '../../helpers/async-helpers'; | 14 | import { sleep } from '../../helpers/async-helpers'; |
16 | 15 | ||
17 | import { SERVER_NOT_LOADED } from '../../config'; | 16 | import { SERVER_NOT_LOADED } from '../../config'; |
18 | import { RECIPES_PATH } from '../../environment'; | 17 | import { osArch, osPlatform, RECIPES_PATH } from '../../environment'; |
19 | import apiBase from '../apiBase'; | 18 | import apiBase from '../apiBase'; |
20 | import { prepareAuthRequest, sendAuthRequest } from '../utils/auth'; | 19 | import { prepareAuthRequest, sendAuthRequest } from '../utils/auth'; |
21 | 20 | ||
@@ -456,7 +455,7 @@ export default class ServerApi { | |||
456 | 455 | ||
457 | // News | 456 | // News |
458 | async getLatestNews() { | 457 | async getLatestNews() { |
459 | const url = `${apiBase(true)}/news?platform=${os.platform()}&arch=${os.arch()}&version=${app.getVersion()}`; | 458 | const url = `${apiBase(true)}/news?platform=${osPlatform}&arch=${osArch}&version=${app.getVersion()}`; |
460 | const request = await sendAuthRequest(url); | 459 | const request = await sendAuthRequest(url); |
461 | if (!request.ok) throw request; | 460 | if (!request.ok) throw request; |
462 | const data = await request.json(); | 461 | const data = await request.json(); |
diff --git a/src/environment.js b/src/environment.js index be6dc7176..758a33380 100644 --- a/src/environment.js +++ b/src/environment.js | |||
@@ -1,3 +1,4 @@ | |||
1 | import os from 'os'; | ||
1 | import path from 'path'; | 2 | import path from 'path'; |
2 | 3 | ||
3 | import { is, api as electronApi } from 'electron-util'; | 4 | import { is, api as electronApi } from 'electron-util'; |
@@ -60,6 +61,10 @@ export const useLiveAPI = process.env.LIVE_API; | |||
60 | export const isMac = is.macos; | 61 | export const isMac = is.macos; |
61 | export const isWindows = is.windows; | 62 | export const isWindows = is.windows; |
62 | export const isLinux = is.linux; | 63 | export const isLinux = is.linux; |
64 | export const osPlatform = os.platform(); | ||
65 | export const osArch = os.arch(); | ||
66 | export const osRelease = os.release(); | ||
67 | export const is64Bit = osArch.match(/64/); | ||
63 | 68 | ||
64 | export const ctrlKey = isMac ? '⌘' : 'Ctrl'; | 69 | export const ctrlKey = isMac ? '⌘' : 'Ctrl'; |
65 | export const cmdKey = isMac ? 'Cmd' : 'Ctrl'; | 70 | export const cmdKey = isMac ? 'Cmd' : 'Ctrl'; |
diff --git a/src/helpers/userAgent-helpers.js b/src/helpers/userAgent-helpers.js index 4aa6f92d0..9c9c8f132 100644 --- a/src/helpers/userAgent-helpers.js +++ b/src/helpers/userAgent-helpers.js | |||
@@ -1,13 +1,11 @@ | |||
1 | import os from 'os'; | 1 | import os from 'os'; |
2 | import macosVersion from 'macos-version'; | 2 | import macosVersion from 'macos-version'; |
3 | import { chromeVersion, isMac, isWindows } from '../environment'; | 3 | import { |
4 | chromeVersion, isMac, isWindows, is64Bit, osArch, osRelease, | ||
5 | } from '../environment'; | ||
4 | 6 | ||
5 | const uaGenerator = require('useragent-generator'); | 7 | const uaGenerator = require('useragent-generator'); |
6 | 8 | ||
7 | function is64Bit() { | ||
8 | return os.arch().match(/64/); | ||
9 | } | ||
10 | |||
11 | function macOS() { | 9 | function macOS() { |
12 | const version = macosVersion(); | 10 | const version = macosVersion(); |
13 | let cpuName = os.cpus()[0].model.split(' ')[0]; | 11 | let cpuName = os.cpus()[0].model.split(' ')[0]; |
@@ -18,14 +16,14 @@ function macOS() { | |||
18 | } | 16 | } |
19 | 17 | ||
20 | function windows() { | 18 | function windows() { |
21 | const version = os.release(); | 19 | const version = osRelease; |
22 | const [majorVersion, minorVersion] = version.split('.'); | 20 | const [majorVersion, minorVersion] = version.split('.'); |
23 | const archString = is64Bit() ? 'Win64' : 'Win32'; | 21 | const archString = is64Bit ? 'Win64' : 'Win32'; |
24 | return `Windows NT ${majorVersion}.${minorVersion}; ${archString}; ${os.arch()}`; | 22 | return `Windows NT ${majorVersion}.${minorVersion}; ${archString}; ${osArch}`; |
25 | } | 23 | } |
26 | 24 | ||
27 | function linux() { | 25 | function linux() { |
28 | const archString = is64Bit() ? 'x86_64' : os.arch(); | 26 | const archString = is64Bit ? 'x86_64' : osArch; |
29 | return `X11; Ubuntu; Linux ${archString}`; | 27 | return `X11; Ubuntu; Linux ${archString}`; |
30 | } | 28 | } |
31 | 29 | ||
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 4da9390a5..370a6fb92 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json | |||
@@ -6142,91 +6142,91 @@ | |||
6142 | "defaultMessage": "!!!Publish debug information", | 6142 | "defaultMessage": "!!!Publish debug information", |
6143 | "end": { | 6143 | "end": { |
6144 | "column": 3, | 6144 | "column": 3, |
6145 | "line": 20 | 6145 | "line": 22 |
6146 | }, | 6146 | }, |
6147 | "file": "src/features/publishDebugInfo/Component.js", | 6147 | "file": "src/features/publishDebugInfo/Component.js", |
6148 | "id": "feature.publishDebugInfo.title", | 6148 | "id": "feature.publishDebugInfo.title", |
6149 | "start": { | 6149 | "start": { |
6150 | "column": 9, | 6150 | "column": 9, |
6151 | "line": 17 | 6151 | "line": 19 |
6152 | } | 6152 | } |
6153 | }, | 6153 | }, |
6154 | { | 6154 | { |
6155 | "defaultMessage": "!!!Publishing your debug information helps us find issues and errors in Ferdi. By publishing your debug information you accept Ferdi Debugger's privacy policy and terms of service", | 6155 | "defaultMessage": "!!!Publishing your debug information helps us find issues and errors in Ferdi. By publishing your debug information you accept Ferdi Debugger's privacy policy and terms of service", |
6156 | "end": { | 6156 | "end": { |
6157 | "column": 3, | 6157 | "column": 3, |
6158 | "line": 24 | 6158 | "line": 26 |
6159 | }, | 6159 | }, |
6160 | "file": "src/features/publishDebugInfo/Component.js", | 6160 | "file": "src/features/publishDebugInfo/Component.js", |
6161 | "id": "feature.publishDebugInfo.info", | 6161 | "id": "feature.publishDebugInfo.info", |
6162 | "start": { | 6162 | "start": { |
6163 | "column": 8, | 6163 | "column": 8, |
6164 | "line": 21 | 6164 | "line": 23 |
6165 | } | 6165 | } |
6166 | }, | 6166 | }, |
6167 | { | 6167 | { |
6168 | "defaultMessage": "!!!There was an error while trying to publish the debug information. Please try again later or view the console for more information.", | 6168 | "defaultMessage": "!!!There was an error while trying to publish the debug information. Please try again later or view the console for more information.", |
6169 | "end": { | 6169 | "end": { |
6170 | "column": 3, | 6170 | "column": 3, |
6171 | "line": 28 | 6171 | "line": 30 |
6172 | }, | 6172 | }, |
6173 | "file": "src/features/publishDebugInfo/Component.js", | 6173 | "file": "src/features/publishDebugInfo/Component.js", |
6174 | "id": "feature.publishDebugInfo.error", | 6174 | "id": "feature.publishDebugInfo.error", |
6175 | "start": { | 6175 | "start": { |
6176 | "column": 9, | 6176 | "column": 9, |
6177 | "line": 25 | 6177 | "line": 27 |
6178 | } | 6178 | } |
6179 | }, | 6179 | }, |
6180 | { | 6180 | { |
6181 | "defaultMessage": "!!!Privacy policy", | 6181 | "defaultMessage": "!!!Privacy policy", |
6182 | "end": { | 6182 | "end": { |
6183 | "column": 3, | 6183 | "column": 3, |
6184 | "line": 32 | 6184 | "line": 34 |
6185 | }, | 6185 | }, |
6186 | "file": "src/features/publishDebugInfo/Component.js", | 6186 | "file": "src/features/publishDebugInfo/Component.js", |
6187 | "id": "feature.publishDebugInfo.privacy", | 6187 | "id": "feature.publishDebugInfo.privacy", |
6188 | "start": { | 6188 | "start": { |
6189 | "column": 11, | 6189 | "column": 11, |
6190 | "line": 29 | 6190 | "line": 31 |
6191 | } | 6191 | } |
6192 | }, | 6192 | }, |
6193 | { | 6193 | { |
6194 | "defaultMessage": "!!!Terms of service", | 6194 | "defaultMessage": "!!!Terms of service", |
6195 | "end": { | 6195 | "end": { |
6196 | "column": 3, | 6196 | "column": 3, |
6197 | "line": 36 | 6197 | "line": 38 |
6198 | }, | 6198 | }, |
6199 | "file": "src/features/publishDebugInfo/Component.js", | 6199 | "file": "src/features/publishDebugInfo/Component.js", |
6200 | "id": "feature.publishDebugInfo.terms", | 6200 | "id": "feature.publishDebugInfo.terms", |
6201 | "start": { | 6201 | "start": { |
6202 | "column": 9, | 6202 | "column": 9, |
6203 | "line": 33 | 6203 | "line": 35 |
6204 | } | 6204 | } |
6205 | }, | 6205 | }, |
6206 | { | 6206 | { |
6207 | "defaultMessage": "!!!Accept and publish", | 6207 | "defaultMessage": "!!!Accept and publish", |
6208 | "end": { | 6208 | "end": { |
6209 | "column": 3, | 6209 | "column": 3, |
6210 | "line": 40 | 6210 | "line": 42 |
6211 | }, | 6211 | }, |
6212 | "file": "src/features/publishDebugInfo/Component.js", | 6212 | "file": "src/features/publishDebugInfo/Component.js", |
6213 | "id": "feature.publishDebugInfo.publish", | 6213 | "id": "feature.publishDebugInfo.publish", |
6214 | "start": { | 6214 | "start": { |
6215 | "column": 11, | 6215 | "column": 11, |
6216 | "line": 37 | 6216 | "line": 39 |
6217 | } | 6217 | } |
6218 | }, | 6218 | }, |
6219 | { | 6219 | { |
6220 | "defaultMessage": "!!!Your debug log was published and is now availible at", | 6220 | "defaultMessage": "!!!Your debug log was published and is now availible at", |
6221 | "end": { | 6221 | "end": { |
6222 | "column": 3, | 6222 | "column": 3, |
6223 | "line": 44 | 6223 | "line": 46 |
6224 | }, | 6224 | }, |
6225 | "file": "src/features/publishDebugInfo/Component.js", | 6225 | "file": "src/features/publishDebugInfo/Component.js", |
6226 | "id": "feature.publishDebugInfo.published", | 6226 | "id": "feature.publishDebugInfo.published", |
6227 | "start": { | 6227 | "start": { |
6228 | "column": 13, | 6228 | "column": 13, |
6229 | "line": 41 | 6229 | "line": 43 |
6230 | } | 6230 | } |
6231 | } | 6231 | } |
6232 | ], | 6232 | ], |
diff --git a/src/lib/TouchBar.js b/src/lib/TouchBar.js index 11eaec306..781cd0895 100644 --- a/src/lib/TouchBar.js +++ b/src/lib/TouchBar.js | |||
@@ -1,9 +1,8 @@ | |||
1 | import os from 'os'; | ||
2 | import semver from 'semver'; | 1 | import semver from 'semver'; |
3 | import { TouchBar, getCurrentWindow } from '@electron/remote'; | 2 | import { TouchBar, getCurrentWindow } from '@electron/remote'; |
4 | import { autorun } from 'mobx'; | 3 | import { autorun } from 'mobx'; |
5 | 4 | ||
6 | import { isMac } from '../environment'; | 5 | import { isMac, osRelease } from '../environment'; |
7 | 6 | ||
8 | export default class FranzTouchBar { | 7 | export default class FranzTouchBar { |
9 | constructor(stores, actions) { | 8 | constructor(stores, actions) { |
@@ -13,7 +12,7 @@ export default class FranzTouchBar { | |||
13 | // Temporary fix for https://github.com/electron/electron/issues/10442 | 12 | // Temporary fix for https://github.com/electron/electron/issues/10442 |
14 | // TODO: remove when we upgrade to electron 1.8.2 or later | 13 | // TODO: remove when we upgrade to electron 1.8.2 or later |
15 | try { | 14 | try { |
16 | if (isMac && semver.gt(os.release(), '16.6.0')) { | 15 | if (isMac && semver.gt(osRelease, '16.6.0')) { |
17 | this.build = autorun(this._build.bind(this)); | 16 | this.build = autorun(this._build.bind(this)); |
18 | } | 17 | } |
19 | } catch (err) { | 18 | } catch (err) { |
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index bbcf78a43..ac6ca6d2d 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -7,7 +7,6 @@ import moment from 'moment'; | |||
7 | import AutoLaunch from 'auto-launch'; | 7 | import AutoLaunch from 'auto-launch'; |
8 | import ms from 'ms'; | 8 | import ms from 'ms'; |
9 | import { URL } from 'url'; | 9 | import { URL } from 'url'; |
10 | import os from 'os'; | ||
11 | import path from 'path'; | 10 | import path from 'path'; |
12 | import { readJsonSync } from 'fs-extra'; | 11 | import { readJsonSync } from 'fs-extra'; |
13 | 12 | ||
@@ -15,7 +14,7 @@ import Store from './lib/Store'; | |||
15 | import Request from './lib/Request'; | 14 | import Request from './lib/Request'; |
16 | import { CHECK_INTERVAL } from '../config'; | 15 | import { CHECK_INTERVAL } from '../config'; |
17 | import { | 16 | import { |
18 | DEFAULT_APP_SETTINGS, isMac, ferdiVersion, electronVersion, | 17 | DEFAULT_APP_SETTINGS, isMac, ferdiVersion, electronVersion, osRelease, |
19 | } from '../environment'; | 18 | } from '../environment'; |
20 | import locales from '../i18n/translations'; | 19 | import locales from '../i18n/translations'; |
21 | import { onVisibilityChange } from '../helpers/visibility-helper'; | 20 | import { onVisibilityChange } from '../helpers/visibility-helper'; |
@@ -261,7 +260,7 @@ export default class AppStore extends Store { | |||
261 | return { | 260 | return { |
262 | host: { | 261 | host: { |
263 | platform: process.platform, | 262 | platform: process.platform, |
264 | release: os.release(), | 263 | release: osRelease, |
265 | screens: screen.getAllDisplays(), | 264 | screens: screen.getAllDisplays(), |
266 | }, | 265 | }, |
267 | ferdi: { | 266 | ferdi: { |