From 0a261d2a7d04e457b53885bca1c6c87fe953db9b Mon Sep 17 00:00:00 2001 From: Exilat Date: Thu, 25 Oct 2018 17:19:31 +0000 Subject: [PATCH 1/3] Adds Occitan locale --- static/timeago-oc.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 static/timeago-oc.json diff --git a/static/timeago-oc.json b/static/timeago-oc.json new file mode 100644 index 00000000..7e439871 --- /dev/null +++ b/static/timeago-oc.json @@ -0,0 +1,10 @@ +[ + "ara meteis", + ["fa %s s", "fa %s s"], + ["fa %s min", "fa %s min"], + ["fa %s h", "fa %s h"], + ["fa %s dia", "fa %s jorns"], + ["fa %s setm.", "fa %s setm."], + ["fa %s mes", "fa %s meses"], + ["fa %s any", "fa %s ans"] +] From 01aba3f9c6fa89106cf5b6322b7919f26e92b21d Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Fri, 26 Oct 2018 10:13:53 +0900 Subject: [PATCH 2/3] adapt to destructive change of api --- src/main.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index 1b1780df..53cee313 100644 --- a/src/main.js +++ b/src/main.js @@ -217,9 +217,20 @@ window.fetch('/nodeinfo/2.0.json') .then((res) => res.json()) .then((data) => { const metadata = data.metadata - store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: data.metadata.mediaProxy }) - store.dispatch('setInstanceOption', { name: 'chatAvailable', value: data.metadata.chat }) - store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: data.metadata.gopher }) + + const features = metadata.features + store.dispatch('setInstanceOption', { + name: 'mediaProxyAvailable', + value: features.findIndex((element, index, array) => (element === 'media_proxy')) >= 0 + }) + store.dispatch('setInstanceOption', { + name: 'chatAvailable', + value: features.findIndex((element, index, array) => (element === 'chat')) >= 0 + }) + store.dispatch('setInstanceOption', { + name: 'gopherAvailable', + value: features.findIndex((element, index, array) => (element === 'gopher')) >= 0 + }) const suggestions = metadata.suggestions store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled }) From 630c6e3e4417be8d79bf3ade011f07d78bf99b44 Mon Sep 17 00:00:00 2001 From: hakabahitoyo Date: Fri, 26 Oct 2018 15:08:51 +0900 Subject: [PATCH 3/3] simplify code --- src/main.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main.js b/src/main.js index 53cee313..b71ae4cb 100644 --- a/src/main.js +++ b/src/main.js @@ -219,18 +219,9 @@ window.fetch('/nodeinfo/2.0.json') const metadata = data.metadata const features = metadata.features - store.dispatch('setInstanceOption', { - name: 'mediaProxyAvailable', - value: features.findIndex((element, index, array) => (element === 'media_proxy')) >= 0 - }) - store.dispatch('setInstanceOption', { - name: 'chatAvailable', - value: features.findIndex((element, index, array) => (element === 'chat')) >= 0 - }) - store.dispatch('setInstanceOption', { - name: 'gopherAvailable', - value: features.findIndex((element, index, array) => (element === 'gopher')) >= 0 - }) + store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') }) + store.dispatch('setInstanceOption', { name: 'chatAvailable', value: features.includes('chat') }) + store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') }) const suggestions = metadata.suggestions store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled })