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.
This commit is contained in:
@@ -36,7 +36,7 @@ const useConversationSidebarItemsOrder = uiSettings => {
|
|||||||
const { conversation_sidebar_items_order: itemsOrder } = uiSettings.value;
|
const { conversation_sidebar_items_order: itemsOrder } = uiSettings.value;
|
||||||
// If the sidebar order is not set, use the default order.
|
// If the sidebar order is not set, use the default order.
|
||||||
if (!itemsOrder) {
|
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.
|
// Create a copy of itemsOrder to avoid mutating the original store object.
|
||||||
const itemsOrderCopy = [...itemsOrder];
|
const itemsOrderCopy = [...itemsOrder];
|
||||||
|
|||||||
Reference in New Issue
Block a user