mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-21 10:43:36 +00:00
fix: prevent store mutation error by creating array copy before sorting
This commit is contained in:
@@ -29,8 +29,8 @@ export const DiskList: Component<DiskListProps> = (props) => {
|
||||
);
|
||||
}
|
||||
|
||||
// Sort by node and devPath
|
||||
return disks.sort((a, b) => {
|
||||
// Sort by node and devPath - create a copy to avoid mutating store
|
||||
return [...disks].sort((a, b) => {
|
||||
if (a.node !== b.node) return a.node.localeCompare(b.node);
|
||||
return a.devPath.localeCompare(b.devPath);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user