diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/api/server/ServerApi.js | 4 | ||||
-rw-r--r-- | src/features/accentColor/index.js | 12 | ||||
-rw-r--r-- | src/index.html | 1 | ||||
-rw-r--r-- | src/index.js | 2 | ||||
-rw-r--r-- | src/sentry.js | 5 |
5 files changed, 22 insertions, 2 deletions
diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js index 164bc237b..627425948 100644 --- a/src/api/server/ServerApi.js +++ b/src/api/server/ServerApi.js | |||
@@ -458,7 +458,7 @@ export default class ServerApi { | |||
458 | 458 | ||
459 | // News | 459 | // News |
460 | async getLatestNews() { | 460 | async getLatestNews() { |
461 | const url = `${apiBase()}/news?platform=${os.platform()}&arch=${os.arch()}&version=${app.getVersion()}`; | 461 | const url = `https://api.getferdi.com/v1/news?platform=${os.platform()}&arch=${os.arch()}&version=${app.getVersion()}`; |
462 | const request = await sendAuthRequest(url); | 462 | const request = await sendAuthRequest(url); |
463 | if (!request.ok) throw request; | 463 | if (!request.ok) throw request; |
464 | const data = await request.json(); | 464 | const data = await request.json(); |
@@ -468,7 +468,7 @@ export default class ServerApi { | |||
468 | } | 468 | } |
469 | 469 | ||
470 | async hideNews(id) { | 470 | async hideNews(id) { |
471 | const request = await sendAuthRequest(`${apiBase()}/news/${id}/read`); | 471 | const request = await sendAuthRequest(`https://api.getferdi.com/v1/news/${id}/read`); |
472 | if (!request.ok) throw request; | 472 | if (!request.ok) throw request; |
473 | debug('ServerApi::hideNews resolves', id); | 473 | debug('ServerApi::hideNews resolves', id); |
474 | } | 474 | } |
diff --git a/src/features/accentColor/index.js b/src/features/accentColor/index.js index a0f57a2fa..90fbcab43 100644 --- a/src/features/accentColor/index.js +++ b/src/features/accentColor/index.js | |||
@@ -4,6 +4,15 @@ import { DEFAULT_APP_SETTINGS } from '../../config'; | |||
4 | 4 | ||
5 | const STYLE_ELEMENT_ID = 'accent-color'; | 5 | const STYLE_ELEMENT_ID = 'accent-color'; |
6 | 6 | ||
7 | // Additional styles needed to make accent colors work properly | ||
8 | // "[ACCENT]" will be replaced with the accent color | ||
9 | const ADDITIONAL_STYLES = ` | ||
10 | .franz-form__button { | ||
11 | background: inherit !important; | ||
12 | border: 2px solid [ACCENT] !important; | ||
13 | } | ||
14 | `; | ||
15 | |||
7 | function createAccentStyleElement() { | 16 | function createAccentStyleElement() { |
8 | const styles = document.createElement('style'); | 17 | const styles = document.createElement('style'); |
9 | styles.id = STYLE_ELEMENT_ID; | 18 | styles.id = STYLE_ELEMENT_ID; |
@@ -13,6 +22,7 @@ function createAccentStyleElement() { | |||
13 | 22 | ||
14 | function setAccentStyle(style) { | 23 | function setAccentStyle(style) { |
15 | const styleElement = document.getElementById(STYLE_ELEMENT_ID); | 24 | const styleElement = document.getElementById(STYLE_ELEMENT_ID); |
25 | |||
16 | styleElement.innerHTML = style; | 26 | styleElement.innerHTML = style; |
17 | } | 27 | } |
18 | 28 | ||
@@ -27,6 +37,8 @@ function generateAccentStyle(color) { | |||
27 | `; | 37 | `; |
28 | }); | 38 | }); |
29 | 39 | ||
40 | style += ADDITIONAL_STYLES.replace(/\[ACCENT\]/g, color); | ||
41 | |||
30 | return style; | 42 | return style; |
31 | } | 43 | } |
32 | 44 | ||
diff --git a/src/index.html b/src/index.html index 7f223b662..31e8aa553 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -14,6 +14,7 @@ | |||
14 | <script> | 14 | <script> |
15 | document.querySelector('body').classList.add(process.env.OS_PLATFORM ? process.env.OS_PLATFORM : process.platform); | 15 | document.querySelector('body').classList.add(process.env.OS_PLATFORM ? process.env.OS_PLATFORM : process.platform); |
16 | 16 | ||
17 | require('./sentry') | ||
17 | const { isDevMode } = require('./environment'); | 18 | const { isDevMode } = require('./environment'); |
18 | if (isDevMode) { | 19 | if (isDevMode) { |
19 | const debugging = require('debug'); | 20 | const debugging = require('debug'); |
diff --git a/src/index.js b/src/index.js index 3453b46f7..bc3c9555a 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -39,6 +39,7 @@ import handleDeepLink from './electron/deepLinking'; | |||
39 | import { isPositionValid } from './electron/windowUtils'; | 39 | import { isPositionValid } from './electron/windowUtils'; |
40 | import { appId } from './package.json'; // eslint-disable-line import/no-unresolved | 40 | import { appId } from './package.json'; // eslint-disable-line import/no-unresolved |
41 | import './electron/exception'; | 41 | import './electron/exception'; |
42 | import './sentry'; | ||
42 | 43 | ||
43 | import { | 44 | import { |
44 | DEFAULT_APP_SETTINGS, | 45 | DEFAULT_APP_SETTINGS, |
@@ -173,6 +174,7 @@ const createWindow = () => { | |||
173 | webPreferences: { | 174 | webPreferences: { |
174 | nodeIntegration: true, | 175 | nodeIntegration: true, |
175 | webviewTag: true, | 176 | webviewTag: true, |
177 | preload: path.join(__dirname, 'sentry.js') | ||
176 | }, | 178 | }, |
177 | }); | 179 | }); |
178 | 180 | ||
diff --git a/src/sentry.js b/src/sentry.js new file mode 100644 index 000000000..4f6d7205d --- /dev/null +++ b/src/sentry.js | |||
@@ -0,0 +1,5 @@ | |||
1 | import * as Sentry from '@sentry/electron'; | ||
2 | |||
3 | Sentry.init({ | ||
4 | dsn: 'https://f3d022fbcf6243a68a58d681c2122ee4@sentry.io/1803053', | ||
5 | }); | ||