chatwoot/app/javascript
Muhsin Keloth 116ed54c7e
fix: Prioritize SDK enableFileUpload flag when explicitly set (#13091)
### Problem
Currently, the attachment button visibility in the widget uses both the
SDK's `enableFileUpload` flag AND the inbox's attachment settings with
an AND condition. This creates an issue for users who want to control
attachments solely through inbox settings, since the SDK flag defaults
to `true` even when not explicitly provided.

  **Before:**
- SDK not set → `enableFileUpload: true` (default) + inbox setting =
attachment shown only if both true
- SDK set to false → `enableFileUpload: false` + inbox setting =
attachment always hidden
- SDK set to true → `enableFileUpload: true` + inbox setting =
attachment shown only if both true
  
This meant users couldn't rely solely on inbox settings when the SDK
flag wasn't explicitly provided.

  ### Solution

Changed the logic to prioritize explicit SDK configuration when
provided, and fall back to inbox settings when not provided:

  **After:**
  - SDK not set → `enableFileUpload: undefined` → use inbox setting only
- SDK set to false → `enableFileUpload: false` → hide attachment (SDK
controls)
- SDK set to true → `enableFileUpload: true` → show attachment (SDK
controls)

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-12-17 19:03:54 +05:30
..
dashboard feat: Custom attribute page redesign (#13087) 2025-12-17 14:30:49 +05:30
design-system feat: Add histoire for component playground (#10256) 2024-10-09 22:10:53 -07:00
entrypoints fix: Prioritize SDK enableFileUpload flag when explicitly set (#13091) 2025-12-17 19:03:54 +05:30
portal feat: Sync Popular Articles locale with widget locale (#11754) 2025-06-24 19:52:44 +05:30
sdk revert: "fix(sdk): Ignore messages from a different origin and sanitizee URLs (#8879)" (#12248) 2025-08-20 21:39:50 +02:00
shared feat: Add plain-text editor for non-rich content channels (#13058) 2025-12-12 10:14:22 +05:30
superadmin_pages chore: fix circleci on vite build (#10214) 2024-10-07 15:27:41 +05:30
survey chore: Update translations (#12748) 2025-11-03 15:45:32 +05:30
v3 feat: Control the allowed login methods via Super Admin (#12892) 2025-11-17 21:55:12 -08:00
widget fix: Prioritize SDK enableFileUpload flag when explicitly set (#13091) 2025-12-17 19:03:54 +05:30
histoire.setup.ts feat: Migrate availability mixins to composable and helper (#11596) 2025-08-22 00:43:34 +05:30