diff --git a/src/app/accounts/destiny-account.ts b/src/app/accounts/destiny-account.ts index 34c7232bc5..4bbc27665d 100644 --- a/src/app/accounts/destiny-account.ts +++ b/src/app/accounts/destiny-account.ts @@ -239,8 +239,7 @@ export function compareAccounts( return Boolean( account1 === account2 || (account1 && - account2 && - account1.membershipId === account2.membershipId && + account1.membershipId === account2?.membershipId && account1.destinyVersion === account2.destinyVersion), ); } diff --git a/src/app/clarity/descriptions/loadDescriptions.ts b/src/app/clarity/descriptions/loadDescriptions.ts index b3eb460dd1..5a6753f446 100644 --- a/src/app/clarity/descriptions/loadDescriptions.ts +++ b/src/app/clarity/descriptions/loadDescriptions.ts @@ -81,7 +81,7 @@ const loadClarityStats = dedupePromise(async (loadFromIndexedDB: boolean) => { liveStatsVersion = await fetchClarity('statsVersion'); if ( liveStatsVersion.schemaVersion === CLARITY_STATS_SUPPORTED_SCHEMA && - (!savedStats || savedStats.lastUpdate !== liveStatsVersion.lastUpdate) + savedStats?.lastUpdate !== liveStatsVersion.lastUpdate ) { // There's been a live update and we support the update's schema -- fetch it return await fetchRemoteStats(liveStatsVersion); diff --git a/src/app/inventory-page/StoreBucket.tsx b/src/app/inventory-page/StoreBucket.tsx index 88f5c48e30..3051b4e4f6 100644 --- a/src/app/inventory-page/StoreBucket.tsx +++ b/src/app/inventory-page/StoreBucket.tsx @@ -279,9 +279,7 @@ export default function StoreBucket({ // updated (so currentStore is cleared) but the store from props is still around because its redux subscription // hasn't fired yet. items = items.filter( - (i) => - i.classType === DestinyClass.Unknown || - (currentStore && i.classType === currentStore.classType), + (i) => i.classType === DestinyClass.Unknown || i.classType === currentStore?.classType, ); } diff --git a/src/app/inventory/item-move-service.ts b/src/app/inventory/item-move-service.ts index f1b9561efc..2d37b5b081 100644 --- a/src/app/inventory/item-move-service.ts +++ b/src/app/inventory/item-move-service.ts @@ -1132,8 +1132,7 @@ export function sortMoveAsideCandidatesForStore( compareBy((displaced) => !displaced.equipped), // prefer same bucket over everything, because that makes space in the correct "pocket" compareBy( - (displaced) => - !fromStore.isVault && displacer && displaced.bucket.hash === displacer.bucket.hash, + (displaced) => !fromStore.isVault && displaced.bucket.hash === displacer?.bucket.hash, ), // TODO: Prefer moving from vault into Inventory (consumables) diff --git a/src/app/inventory/store/sockets.ts b/src/app/inventory/store/sockets.ts index 1d468614ca..f1dc5b9b20 100644 --- a/src/app/inventory/store/sockets.ts +++ b/src/app/inventory/store/sockets.ts @@ -707,7 +707,7 @@ function buildSocket( if (reusablePlugs) { // Get options from live info for (const reusablePlug of reusablePlugs) { - if (plugged && reusablePlug.plugItemHash === plugged.plugDef.hash) { + if (reusablePlug.plugItemHash === plugged?.plugDef.hash) { if (addPlug(plugged)) { foundPluggedInOptions = true; } @@ -723,7 +723,7 @@ function buildSocket( const plugSet = defs.PlugSet.get(socketDef.reusablePlugSetHash, forThisItem); if (plugSet) { for (const reusablePlug of plugSet.reusablePlugItems) { - if (plugged && reusablePlug.plugItemHash === plugged.plugDef.hash) { + if (reusablePlug.plugItemHash === plugged?.plugDef.hash) { if (addPlug(plugged)) { foundPluggedInOptions = true; } @@ -742,7 +742,7 @@ function buildSocket( } else if (socketDef.reusablePlugItems) { // Get options from definition itself for (const reusablePlug of socketDef.reusablePlugItems) { - if (plugged && reusablePlug.plugItemHash === plugged.plugDef.hash) { + if (reusablePlug.plugItemHash === plugged?.plugDef.hash) { if (addPlug(plugged)) { foundPluggedInOptions = true; } diff --git a/src/app/loadout/mod-assignment-utils.ts b/src/app/loadout/mod-assignment-utils.ts index e46c76745d..9e48ed93a5 100644 --- a/src/app/loadout/mod-assignment-utils.ts +++ b/src/app/loadout/mod-assignment-utils.ts @@ -1025,7 +1025,7 @@ function isAssigningToDefault(item: DimItem, assignment: Assignment) { item.hash, ); } - return socket && assignment.mod.hash === socket.emptyPlugItemHash; + return assignment.mod.hash === socket?.emptyPlugItemHash; } /** diff --git a/src/app/search/items/search-filters/sockets.ts b/src/app/search/items/search-filters/sockets.ts index 016e845156..db59f6357b 100644 --- a/src/app/search/items/search-filters/sockets.ts +++ b/src/app/search/items/search-filters/sockets.ts @@ -108,8 +108,7 @@ const socketFilters: ItemFilterDefinition[] = [ filter: () => (item) => item.sockets?.allSockets.some((socket) => Boolean( - socket.plugged && - socket.plugged.plugDef.itemSubType === DestinyItemSubType.Shader && + socket.plugged?.plugDef.itemSubType === DestinyItemSubType.Shader && socket.plugged.plugDef.hash !== DEFAULT_SHADER, ), ),