diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-08-21 16:32:10 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-21 16:32:10 +0530 |
commit | 04d1e0aaecdb0235d9a281b16f9eddccddb4cb57 (patch) | |
tree | 533d9ced0128aa28d56d58430a757b166c809804 /src | |
parent | chore: added TODO and regenerated file [skip ci] (diff) | |
download | ferdium-app-04d1e0aaecdb0235d9a281b16f9eddccddb4cb57.tar.gz ferdium-app-04d1e0aaecdb0235d9a281b16f9eddccddb4cb57.tar.zst ferdium-app-04d1e0aaecdb0235d9a281b16f9eddccddb4cb57.zip |
Incorrect position while adding a new service when there were pre-existing services (#1820)
Diffstat (limited to 'src')
-rw-r--r-- | src/config.ts | 2 | ||||
-rw-r--r-- | src/internal-server/app/Controllers/Http/ServiceController.js | 8 | ||||
-rw-r--r-- | src/models/Service.js | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/config.ts b/src/config.ts index 005dd3601..0647b8f52 100644 --- a/src/config.ts +++ b/src/config.ts | |||
@@ -181,3 +181,5 @@ export const DEFAULT_IS_FEATURE_ENABLED_BY_USER = true; | |||
181 | export const TODOS_PARTITION_ID = 'persist:todos'; | 181 | export const TODOS_PARTITION_ID = 'persist:todos'; |
182 | 182 | ||
183 | export const CUSTOM_WEBSITE_RECIPE_ID = 'franz-custom-website'; | 183 | export const CUSTOM_WEBSITE_RECIPE_ID = 'franz-custom-website'; |
184 | |||
185 | export const DEFAULT_SERVICE_ORDER = 99; // something high enough that it gets added to the end of the already-added services on the left sidebar | ||
diff --git a/src/internal-server/app/Controllers/Http/ServiceController.js b/src/internal-server/app/Controllers/Http/ServiceController.js index c76a287f7..312306abf 100644 --- a/src/internal-server/app/Controllers/Http/ServiceController.js +++ b/src/internal-server/app/Controllers/Http/ServiceController.js | |||
@@ -5,7 +5,7 @@ const Env = use('Env'); | |||
5 | const uuid = require('uuid/v4'); | 5 | const uuid = require('uuid/v4'); |
6 | const path = require('path'); | 6 | const path = require('path'); |
7 | const fs = require('fs-extra'); | 7 | const fs = require('fs-extra'); |
8 | const { LOCAL_HOSTNAME } = require('../../../../config'); | 8 | const { LOCAL_HOSTNAME, DEFAULT_SERVICE_ORDER } = require('../../../../config'); |
9 | 9 | ||
10 | const hostname = LOCAL_HOSTNAME; | 10 | const hostname = LOCAL_HOSTNAME; |
11 | const port = Env.get('PORT'); | 11 | const port = Env.get('PORT'); |
@@ -54,7 +54,7 @@ class ServiceController { | |||
54 | isMuted: false, | 54 | isMuted: false, |
55 | isDarkModeEnabled: '', // TODO: This should ideally be a boolean (false). But, changing it caused the sidebar toggle to not work. | 55 | isDarkModeEnabled: '', // TODO: This should ideally be a boolean (false). But, changing it caused the sidebar toggle to not work. |
56 | spellcheckerLanguage: '', | 56 | spellcheckerLanguage: '', |
57 | order: 1, | 57 | order: DEFAULT_SERVICE_ORDER, |
58 | customRecipe: false, | 58 | customRecipe: false, |
59 | hasCustomIcon: false, | 59 | hasCustomIcon: false, |
60 | workspaces: [], | 60 | workspaces: [], |
@@ -83,7 +83,7 @@ class ServiceController { | |||
83 | isEnabled: true, | 83 | isEnabled: true, |
84 | isMuted: false, | 84 | isMuted: false, |
85 | isNotificationEnabled: true, | 85 | isNotificationEnabled: true, |
86 | order: 1, | 86 | order: DEFAULT_SERVICE_ORDER, |
87 | spellcheckerLanguage: '', | 87 | spellcheckerLanguage: '', |
88 | workspaces: [], | 88 | workspaces: [], |
89 | ...JSON.parse(service.settings), | 89 | ...JSON.parse(service.settings), |
@@ -257,7 +257,7 @@ class ServiceController { | |||
257 | isEnabled: true, | 257 | isEnabled: true, |
258 | isMuted: false, | 258 | isMuted: false, |
259 | isNotificationEnabled: true, | 259 | isNotificationEnabled: true, |
260 | order: 1, | 260 | order: DEFAULT_SERVICE_ORDER, |
261 | spellcheckerLanguage: '', | 261 | spellcheckerLanguage: '', |
262 | workspaces: [], | 262 | workspaces: [], |
263 | ...JSON.parse(service.settings), | 263 | ...JSON.parse(service.settings), |
diff --git a/src/models/Service.js b/src/models/Service.js index fe56e5a76..c2b081864 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -7,6 +7,7 @@ import { join } from 'path'; | |||
7 | import { todosStore } from '../features/todos'; | 7 | import { todosStore } from '../features/todos'; |
8 | import { isValidExternalURL } from '../helpers/url-helpers'; | 8 | import { isValidExternalURL } from '../helpers/url-helpers'; |
9 | import UserAgent from './UserAgent'; | 9 | import UserAgent from './UserAgent'; |
10 | import { DEFAULT_SERVICE_ORDER } from '../config'; | ||
10 | 11 | ||
11 | const debug = require('debug')('Ferdi:Service'); | 12 | const debug = require('debug')('Ferdi:Service'); |
12 | 13 | ||
@@ -31,7 +32,7 @@ export default class Service { | |||
31 | 32 | ||
32 | @observable unreadIndirectMessageCount = 0; | 33 | @observable unreadIndirectMessageCount = 0; |
33 | 34 | ||
34 | @observable order = 99; | 35 | @observable order = DEFAULT_SERVICE_ORDER; |
35 | 36 | ||
36 | @observable isEnabled = true; | 37 | @observable isEnabled = true; |
37 | 38 | ||