chatwoot/app/javascript/widget
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
..
api chore: Limit the number of articles retrieved by widget (#11095) 2025-03-15 14:10:12 -07:00
assets chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
components fix: Prioritize SDK enableFileUpload flag when explicitly set (#13091) 2025-12-17 19:03:54 +05:30
composables fix: Prioritize SDK enableFileUpload flag when explicitly set (#13091) 2025-12-17 19:03:54 +05:30
constants feat: widget opened and closed events (#11240) 2025-04-24 17:01:39 +05:30
helpers feat: Convert availability slots to local timezone (#12273) 2025-08-22 16:12:24 +05:30
i18n chore: Update translations (#12748) 2025-11-03 15:45:32 +05:30
mixins feat: Migrate availability mixins to composable and helper (#11596) 2025-08-22 00:43:34 +05:30
store fix: Prioritize SDK enableFileUpload flag when explicitly set (#13091) 2025-12-17 19:03:54 +05:30
views feat: Migrate availability mixins to composable and helper (#11596) 2025-08-22 00:43:34 +05:30
App.vue feat: Migrate availability mixins to composable and helper (#11596) 2025-08-22 00:43:34 +05:30
router.js chore: Add cache to improve widget performance (#11163) 2025-03-24 16:04:49 -07:00