Skip to content

Commit 88e990e

Browse files
authored
Merge pull request #10916 from DestinyItemManager/fix-search-sync
Fix loading searches
2 parents 5c76e82 + 60bcb95 commit 88e990e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/app/dim-api/actions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export function loadDimApiData(
253253
try {
254254
const syncToken =
255255
currentAccount && $featureFlags.dimApiSync && !forceLoad
256-
? getState().dimApi.profiles?.[makeProfileKeyFromAccount(currentAccount)]?.syncToken
256+
? getState().dimApi.profiles?.[makeProfileKeyFromAccount(currentAccount)]?.sync
257257
: undefined;
258258
const profileResponse = await getDimApiProfile(currentAccount, syncToken);
259259
dispatch(profileLoaded({ profileResponse, account: currentAccount }));

src/app/dim-api/reducer.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export interface DimApiState {
8989
triumphs: number[];
9090

9191
/** This allows us to get just the items that changed from the DIM API instead of the whole deal. */
92-
syncToken?: string;
92+
sync?: string;
9393
};
9494
};
9595

@@ -421,6 +421,8 @@ function profileLoaded(
421421
);
422422
if (foundSearchIndex >= 0) {
423423
newSearches[foundSearchIndex] = search;
424+
} else {
425+
newSearches.push(search);
424426
}
425427
}
426428
for (const searchHash of profileResponse.deletedSearchHashes ?? []) {
@@ -467,7 +469,7 @@ function profileLoaded(
467469
loadouts: newLoadouts,
468470
tags: newTags,
469471
triumphs: [...newTriumphs],
470-
syncToken: profileResponse.syncToken,
472+
sync: profileResponse.syncToken,
471473
},
472474
};
473475
}

0 commit comments

Comments
 (0)