Skip to content

Commit

Permalink
fix: weapons not updating on sort (#2181)
Browse files Browse the repository at this point in the history
Due to array mutation. Now array is copied and then sorted so the changes are detected.
  • Loading branch information
NigelBreslaw authored Jul 28, 2024
1 parent bed50f2 commit ae86a13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion native/app/store/InventoryLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export function returnBorderColor(item: DestinyItem): string {
}

function sortInventoryArray(get: AccountSliceGetter, dataArray: DestinyItem[], bucketHash: BucketHash): DestinyItem[] {
let existingArray = dataArray as DestinyItemSort[];
let existingArray = dataArray.slice(0) as DestinyItemSort[];
if (weaponBuckets.includes(bucketHash)) {
const weaponsSort = get().weaponsSort;
switch (weaponsSort) {
Expand Down

0 comments on commit ae86a13

Please sign in to comment.