diff --git a/src/components/flow/actions/localization/MsgLocalizationForm.tsx b/src/components/flow/actions/localization/MsgLocalizationForm.tsx index d002343e9..e9e1d97b3 100644 --- a/src/components/flow/actions/localization/MsgLocalizationForm.tsx +++ b/src/components/flow/actions/localization/MsgLocalizationForm.tsx @@ -191,7 +191,6 @@ export default class MsgLocalizationForm extends React.Component< const attachments: any = mutate(this.state.attachments, { $push: [{ type: response.data.type, url: response.data.url, uploaded: true }] }); - console.log(attachments); this.setState({ attachments }); const uploadError: string = ''; diff --git a/src/services/Localization.ts b/src/services/Localization.ts index e5b56a06d..e917de07d 100644 --- a/src/services/Localization.ts +++ b/src/services/Localization.ts @@ -1,6 +1,9 @@ import { Action, Case, Category, Language, MsgTemplating } from 'flowTypes'; import { Asset } from 'store/flowContext'; +// list of keys that should always be treated as an array +const ARRAY_KEYS = ['attachments']; + export class LocalizedObject { public localizedKeys: { [key: string]: boolean } = {}; @@ -40,7 +43,7 @@ export class LocalizedObject { this.localized = true; } - if (Array.isArray(this.localizedObject[key])) { + if (Array.isArray(this.localizedObject[key]) || ARRAY_KEYS.includes(key)) { this.localizedObject[key] = value; } else { if (value.length === 1) { diff --git a/src/temba/TembaSelect.tsx b/src/temba/TembaSelect.tsx index 8e9ab6b7b..feb7209ff 100644 --- a/src/temba/TembaSelect.tsx +++ b/src/temba/TembaSelect.tsx @@ -165,12 +165,6 @@ export default class TembaSelect extends React.Component { - if (!option) { - throw new Error('No option found for selection'); - } - }); } if (this.props.onChange) {