Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/app/accounts/destiny-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
}
2 changes: 1 addition & 1 deletion src/app/clarity/descriptions/loadDescriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const loadClarityStats = dedupePromise(async (loadFromIndexedDB: boolean) => {
liveStatsVersion = await fetchClarity<ClarityStatsVersion>('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);
Expand Down
4 changes: 1 addition & 3 deletions src/app/inventory-page/StoreBucket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
}

Expand Down
3 changes: 1 addition & 2 deletions src/app/inventory/item-move-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/app/inventory/store/sockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/loadout/mod-assignment-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/app/search/items/search-filters/sockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
Expand Down