From 50344a282be5026770cdf5d3659f7a87d662c949 Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 11 Apr 2025 13:02:16 +0530 Subject: [PATCH] fix: Return new Array instead of freezed object (#11283) Users who have not changed the order of the sidebar items were not able to change it as the object returned was created using Object.freeze To reproduce: - Create a new user account, open a conversation, try changing the order of the sidebar items. --- app/javascript/dashboard/composables/useUISettings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/dashboard/composables/useUISettings.js b/app/javascript/dashboard/composables/useUISettings.js index f67f58ebc..418011e10 100644 --- a/app/javascript/dashboard/composables/useUISettings.js +++ b/app/javascript/dashboard/composables/useUISettings.js @@ -36,7 +36,7 @@ const useConversationSidebarItemsOrder = uiSettings => { const { conversation_sidebar_items_order: itemsOrder } = uiSettings.value; // If the sidebar order is not set, use the default order. if (!itemsOrder) { - return DEFAULT_CONVERSATION_SIDEBAR_ITEMS_ORDER; + return [...DEFAULT_CONVERSATION_SIDEBAR_ITEMS_ORDER]; } // Create a copy of itemsOrder to avoid mutating the original store object. const itemsOrderCopy = [...itemsOrder];