Skip to content

Commit

Permalink
Use optional chaining for share grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Sep 1, 2021
1 parent 570fd4a commit d4d447f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web-app-files/src/helpers/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function aggregateResourceShares(
const resources = []
let prev = null
for (const share of shares) {
if (prev && prev.storage_id === share.storage_id && prev.file_source === share.file_source) {
if (prev?.storage_id === share.storage_id && prev?.file_source === share.file_source) {
if (userShareTypes.includes(share.share_type)) {
prev.sharedWith.push({
username: share.share_with,
Expand Down

0 comments on commit d4d447f

Please sign in to comment.