Project-Pandora-Game / pandora

https://project-pandora.com
Other
11 stars 3 forks source link

[FEATURE] Sorting of room characters list #728

Closed purpleharmony closed 4 months ago

purpleharmony commented 4 months ago

Fixes #716

The proposed order is

The ordering within groups is from last to join to first to join; because in JS sets preserve insertion order and sorting is stable.

Right now, the useMemo is kinda useless because characters changes everytime someone moves around in the space, causing the whole component as well as the useMemo to run again. I think it might be a good idea to separate the Character type in two in order to avoid re-rendering the whole component when the list hasn't changed.