Skip to content

Commit

Permalink
[lib] Simplify getRelativeMemberInfos
Browse files Browse the repository at this point in the history
Summary:
In subsequent diff going to split into two separate functions: `getLegacyRelativeMemberInfos` and `getMinimallyEncodedRelativeMemberInfos` and then toggle between then based on whether input `RawThreadInfo` is `minimallyEncoded` or not.

Since that diff is about duplicating existing functionality and branching... figure changing the actual functionality may be annoying for reviewers even though it's minimal (?)

---

Depends on D10227

Test Plan: CI/`flow`/etc.

Reviewers: ashoat, ginsu, tomek, rohan

Reviewed By: ashoat

Differential Revision: https://phab.comm.dev/D10233
  • Loading branch information
atulsmadhugiri committed Dec 13, 2023
1 parent d86606c commit 1b12b93
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/selectors/user-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,15 @@ function getRelativeMemberInfos(
: null;
if (memberInfo.id === currentUserID) {
relativeMemberInfos.unshift({
id: memberInfo.id,
role: memberInfo.role,
permissions: memberInfo.permissions,
...memberInfo,
username,
isViewer: true,
isSender: memberInfo.isSender,
});
} else {
relativeMemberInfos.push({
id: memberInfo.id,
role: memberInfo.role,
permissions: memberInfo.permissions,
...memberInfo,
username,
isViewer: false,
isSender: memberInfo.isSender,
});
}
}
Expand Down

0 comments on commit 1b12b93

Please sign in to comment.