diff options
Diffstat (limited to 'src/models/Service.ts')
-rw-r--r-- | src/models/Service.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/models/Service.ts b/src/models/Service.ts index c4165e59a..dfc074204 100644 --- a/src/models/Service.ts +++ b/src/models/Service.ts | |||
@@ -10,7 +10,7 @@ import { isValidExternalURL } from '../helpers/url-helpers'; | |||
10 | import UserAgent from './UserAgent'; | 10 | import UserAgent from './UserAgent'; |
11 | import { DEFAULT_SERVICE_ORDER } from '../config'; | 11 | import { DEFAULT_SERVICE_ORDER } from '../config'; |
12 | import { ifUndefined } from '../jsUtils'; | 12 | import { ifUndefined } from '../jsUtils'; |
13 | import Recipe from './Recipe'; | 13 | import { IRecipe } from './Recipe'; |
14 | 14 | ||
15 | const debug = require('../preload-safe-debug')('Ferdium:Service'); | 15 | const debug = require('../preload-safe-debug')('Ferdium:Service'); |
16 | 16 | ||
@@ -18,7 +18,7 @@ const debug = require('../preload-safe-debug')('Ferdium:Service'); | |||
18 | export default class Service { | 18 | export default class Service { |
19 | id: string = ''; | 19 | id: string = ''; |
20 | 20 | ||
21 | recipe: Recipe; | 21 | recipe: IRecipe; |
22 | 22 | ||
23 | _webview: ElectronWebView | null = null; | 23 | _webview: ElectronWebView | null = null; |
24 | 24 | ||
@@ -117,7 +117,7 @@ export default class Service { | |||
117 | 117 | ||
118 | @observable proxy: string | null = null; | 118 | @observable proxy: string | null = null; |
119 | 119 | ||
120 | constructor(data, recipe: Recipe) { | 120 | constructor(data, recipe: IRecipe) { |
121 | if (!data) { | 121 | if (!data) { |
122 | throw new Error('Service config not valid'); | 122 | throw new Error('Service config not valid'); |
123 | } | 123 | } |
@@ -270,8 +270,9 @@ export default class Service { | |||
270 | ); | 270 | ); |
271 | } | 271 | } |
272 | 272 | ||
273 | if (typeof this.recipe.buildUrl === 'function') { | 273 | const { buildUrl } = this.recipe; |
274 | url = this.recipe.buildUrl(url); | 274 | if (typeof buildUrl === 'function') { |
275 | url = buildUrl(url); | ||
275 | } | 276 | } |
276 | 277 | ||
277 | return url; | 278 | return url; |