diff --git a/src/app/dim-api/actions.ts b/src/app/dim-api/actions.ts index cfbe8296c..ef6c726db 100644 --- a/src/app/dim-api/actions.ts +++ b/src/app/dim-api/actions.ts @@ -253,7 +253,7 @@ export function loadDimApiData( try { const syncToken = currentAccount && $featureFlags.dimApiSync && !forceLoad - ? getState().dimApi.profiles?.[makeProfileKeyFromAccount(currentAccount)]?.syncToken + ? getState().dimApi.profiles?.[makeProfileKeyFromAccount(currentAccount)]?.sync : undefined; const profileResponse = await getDimApiProfile(currentAccount, syncToken); dispatch(profileLoaded({ profileResponse, account: currentAccount })); diff --git a/src/app/dim-api/reducer.ts b/src/app/dim-api/reducer.ts index 21f45560c..aee01beb8 100644 --- a/src/app/dim-api/reducer.ts +++ b/src/app/dim-api/reducer.ts @@ -89,7 +89,7 @@ export interface DimApiState { triumphs: number[]; /** This allows us to get just the items that changed from the DIM API instead of the whole deal. */ - syncToken?: string; + sync?: string; }; }; @@ -421,6 +421,8 @@ function profileLoaded( ); if (foundSearchIndex >= 0) { newSearches[foundSearchIndex] = search; + } else { + newSearches.push(search); } } for (const searchHash of profileResponse.deletedSearchHashes ?? []) { @@ -467,7 +469,7 @@ function profileLoaded( loadouts: newLoadouts, tags: newTags, triumphs: [...newTriumphs], - syncToken: profileResponse.syncToken, + sync: profileResponse.syncToken, }, }; }