Fix Friends List Rendering and LocaleCompare Error in FriendsGroup Computed Properties #752

Closed
opened 2026-04-05 16:25:57 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @refiaa on 9/10/2024

This PR addresses issue #909, which caused the friends list to fail to render and resulted in a localeCompare error due to invalid or missing name properties during sorting.

Key Changes:

  1. compareByName Function Update:

    • Adjusted the compareByName function to handle cases where name properties may be undefined or missing. Now, it safely compares strings or returns 0 for invalid data.
  2. API.getUser Error Handling:

    • Enhanced the API.getUser method to ensure only valid user data is processed. If a user lacks a name property, the method now logs an error and avoids emitting invalid data.
  3. FriendsGroup Computed Properties Fix:

    • Restored the friendsGroup1, friendsGroup2, and friendsGroup3 computed properties to their original logic while ensuring proper sorting of valid data.
    • Simplified unnecessary data filtering, which was causing issues in displaying the friends list.

These changes resolve the rendering issue while ensuring that invalid data no longer disrupts the friends list display.

*Originally created by @refiaa on 9/10/2024* This PR addresses issue [#909](https://github.com/vrcx-team/VRCX/issues/909), which caused the friends list to fail to render and resulted in a `localeCompare` error due to invalid or missing `name` properties during sorting. ### Key Changes: 1. **compareByName Function Update**: - Adjusted the `compareByName` function to handle cases where `name` properties may be `undefined` or missing. Now, it safely compares strings or returns `0` for invalid data. 2. **API.getUser Error Handling**: - Enhanced the `API.getUser` method to ensure only valid user data is processed. If a user lacks a `name` property, the method now logs an error and avoids emitting invalid data. 3. **FriendsGroup Computed Properties Fix**: - Restored the `friendsGroup1`, `friendsGroup2`, and `friendsGroup3` computed properties to their original logic while ensuring proper sorting of valid data. - Simplified unnecessary data filtering, which was causing issues in displaying the friends list. These changes resolve the rendering issue while ensuring that invalid data no longer disrupts the friends list display.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/VRCX#752