From 92521fbfb9b8e883eea3b072c634418a00476822 Mon Sep 17 00:00:00 2001 From: Romina Date: Fri, 4 Dec 2020 11:40:12 -0300 Subject: [PATCH] fix(options): convert to array to be safe --- package.json | 2 +- src/surveys.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 524694f..12f804b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ushahidi-platform-sdk", - "version": "v0.3.5", + "version": "v0.3.6", "description": "An SDK for the Ushahidi Platform - V3+ compatible", "engines": { "node": ">= 10 <13" diff --git a/src/surveys.ts b/src/surveys.ts index 19498d6..7fc0f26 100644 --- a/src/surveys.ts +++ b/src/surveys.ts @@ -12,7 +12,7 @@ export class Surveys { } static fieldHasTranslations = (field, lang) => { - return field.translations[lang] && field.translations[lang].options && field.translations[lang].options.length > 0; + return field.translations[lang] && field.translations[lang].options && Object.values(field.translations[lang].options).length > 0; } static fieldCanHaveOptions = (field) => {