aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-06-06 16:36:11 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-06-06 16:38:32 +0530
commitfd1fcbb1c00960453ba5ffcba4b6d0ca88396a02 (patch)
tree2b649156143476761fd9afa1b6d4db5bbce7b5af
parentBuild Ferdi for freeBSD (diff)
downloadferdi-fd1fcbb1c00960453ba5ffcba4b6d0ca88396a02.tar.gz
ferdi-fd1fcbb1c00960453ba5ffcba4b6d0ca88396a02.tar.zst
ferdi-fd1fcbb1c00960453ba5ffcba4b6d0ca88396a02.zip
Extracted common string into constant.
-rw-r--r--src/config.js4
-rw-r--r--src/electron/ipc-api/autoUpdate.js5
-rw-r--r--src/features/announcements/api.js3
3 files changed, 9 insertions, 3 deletions
diff --git a/src/config.js b/src/config.js
index da2eff0c..8930c755 100644
--- a/src/config.js
+++ b/src/config.js
@@ -179,6 +179,10 @@ export const FRANZ_SERVICE_REQUEST = `${GITHUB_FERDI_URL}/recipes/issues`;
179export const FRANZ_TRANSLATION = 'https://crowdin.com/project/getferdi'; 179export const FRANZ_TRANSLATION = 'https://crowdin.com/project/getferdi';
180export const FRANZ_DEV_DOCS = 'http://bit.ly/franz-dev-hub'; 180export const FRANZ_DEV_DOCS = 'http://bit.ly/franz-dev-hub';
181 181
182export const GITHUB_ORG_NAME = 'getferdi';
183export const GITHUB_FERDI_REPO_NAME = 'ferdi';
184export const GITHUB_NIGHTLIES_REPO_NAME = 'nightlies';
185
182export const FILE_SYSTEM_SETTINGS_TYPES = [ 186export const FILE_SYSTEM_SETTINGS_TYPES = [
183 'app', 187 'app',
184 'proxy', 188 'proxy',
diff --git a/src/electron/ipc-api/autoUpdate.js b/src/electron/ipc-api/autoUpdate.js
index 58eda801..603049c4 100644
--- a/src/electron/ipc-api/autoUpdate.js
+++ b/src/electron/ipc-api/autoUpdate.js
@@ -1,5 +1,6 @@
1import { app, ipcMain } from 'electron'; 1import { app, ipcMain } from 'electron';
2import { autoUpdater } from 'electron-updater'; 2import { autoUpdater } from 'electron-updater';
3import { GITHUB_NIGHTLIES_REPO_NAME, GITHUB_ORG_NAME } from '../../config';
3import { isMac, isWindows } from '../../environment'; 4import { isMac, isWindows } from '../../environment';
4 5
5const debug = require('debug')('Ferdi:ipcApi:autoUpdate'); 6const debug = require('debug')('Ferdi:ipcApi:autoUpdate');
@@ -21,8 +22,8 @@ export default (params) => {
21 autoUpdater.allowPrerelease = Boolean(params.settings.app.get('nightly')); 22 autoUpdater.allowPrerelease = Boolean(params.settings.app.get('nightly'));
22 autoUpdater.setFeedURL({ 23 autoUpdater.setFeedURL({
23 provider: 'github', 24 provider: 'github',
24 repo: 'nightlies', 25 owner: GITHUB_ORG_NAME,
25 owner: 'getferdi', 26 repo: GITHUB_NIGHTLIES_REPO_NAME,
26 }); 27 });
27 } 28 }
28 29
diff --git a/src/features/announcements/api.js b/src/features/announcements/api.js
index 2c4d11d0..f34a6274 100644
--- a/src/features/announcements/api.js
+++ b/src/features/announcements/api.js
@@ -1,6 +1,7 @@
1import { app } from '@electron/remote'; 1import { app } from '@electron/remote';
2import Request from '../../stores/lib/Request'; 2import Request from '../../stores/lib/Request';
3import apiBase from '../../api/apiBase'; 3import apiBase from '../../api/apiBase';
4import { GITHUB_FERDI_REPO_NAME, GITHUB_ORG_NAME } from '../../config';
4 5
5const debug = require('debug')('Ferdi:feature:announcements:api'); 6const debug = require('debug')('Ferdi:feature:announcements:api');
6 7
@@ -11,7 +12,7 @@ export const announcementsApi = {
11 }, 12 },
12 13
13 async getChangelog(version) { 14 async getChangelog(version) {
14 const url = `https://api.github.com/repos/getferdi/ferdi/releases/tags/v${version}`; 15 const url = `https://api.github.com/repos/${GITHUB_ORG_NAME}/${GITHUB_FERDI_REPO_NAME}/releases/tags/v${version}`;
15 debug(`fetching release changelog from Github url: ${url}`); 16 debug(`fetching release changelog from Github url: ${url}`);
16 const request = await window.fetch(url, { method: 'GET' }); 17 const request = await window.fetch(url, { method: 'GET' });
17 if (!request.ok) return null; 18 if (!request.ok) return null;