diff options
Diffstat (limited to 'recipes/pleroma')
-rw-r--r-- | recipes/pleroma/index.js | 36 | ||||
-rw-r--r-- | recipes/pleroma/package.json | 2 | ||||
-rw-r--r-- | recipes/pleroma/webview.js | 2 |
3 files changed, 22 insertions, 18 deletions
diff --git a/recipes/pleroma/index.js b/recipes/pleroma/index.js index 67a0e19..2050059 100644 --- a/recipes/pleroma/index.js +++ b/recipes/pleroma/index.js | |||
@@ -1,19 +1,21 @@ | |||
1 | module.exports = Ferdium => class Pleroma extends Ferdium { | 1 | module.exports = Ferdium => |
2 | async validateUrl(url) { | 2 | class Pleroma extends Ferdium { |
3 | try { | 3 | async validateUrl(url) { |
4 | const resp = await window.fetch(`${url}/api/v1/instance`, { | 4 | try { |
5 | Accept: 'application/json', | 5 | const resp = await window.fetch(`${url}/api/v1/instance`, { |
6 | }); | 6 | Accept: 'application/json', |
7 | const data = await resp.json(); | 7 | }); |
8 | const version = data.version; | 8 | const data = await resp.json(); |
9 | return typeof (version) === 'string' && version.includes('Pleroma'); | 9 | const version = data.version; |
10 | } catch (error) { | 10 | return typeof version === 'string' && version.includes('Pleroma'); |
11 | console.log('Pleroma server validation error', error); | 11 | } catch (error) { |
12 | // eslint-disable-next-line no-console | ||
13 | console.log('Pleroma server validation error', error); | ||
14 | } | ||
15 | return false; | ||
12 | } | 16 | } |
13 | return false; | ||
14 | } | ||
15 | 17 | ||
16 | buildUrl(url) { | 18 | buildUrl(url) { |
17 | return `${url}/main/friends`; | 19 | return `${url}/main/friends`; |
18 | } | 20 | } |
19 | }; | 21 | }; |
diff --git a/recipes/pleroma/package.json b/recipes/pleroma/package.json index de92244..5819a75 100644 --- a/recipes/pleroma/package.json +++ b/recipes/pleroma/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "pleroma", | 2 | "id": "pleroma", |
3 | "name": "Pleroma", | 3 | "name": "Pleroma", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "hasCustomUrl": true | 7 | "hasCustomUrl": true |
diff --git a/recipes/pleroma/webview.js b/recipes/pleroma/webview.js index 41516f6..703a53f 100644 --- a/recipes/pleroma/webview.js +++ b/recipes/pleroma/webview.js | |||
@@ -16,6 +16,7 @@ const getInstanceConfig = async () => { | |||
16 | const pleromaFeConfig = frontendConfig.pleroma_fe || {}; | 16 | const pleromaFeConfig = frontendConfig.pleroma_fe || {}; |
17 | return { ...staticConfig, ...pleromaFeConfig }; | 17 | return { ...staticConfig, ...pleromaFeConfig }; |
18 | } catch (error) { | 18 | } catch (error) { |
19 | // eslint-disable-next-line no-console | ||
19 | console.log('Failed to load dynamic frontend configuration', error); | 20 | console.log('Failed to load dynamic frontend configuration', error); |
20 | return staticConfig; | 21 | return staticConfig; |
21 | } | 22 | } |
@@ -162,6 +163,7 @@ module.exports = Ferdium => { | |||
162 | }); | 163 | }); |
163 | }, | 164 | }, |
164 | error => { | 165 | error => { |
166 | // eslint-disable-next-line no-console | ||
165 | console.log('Failed to load instance logo', error); | 167 | console.log('Failed to load instance logo', error); |
166 | Ferdium.loop(getMessages); | 168 | Ferdium.loop(getMessages); |
167 | }, | 169 | }, |