Skip to content

Commit

Permalink
[lib] Factor out defaultSubscription in createPendingThread
Browse files Browse the repository at this point in the history
Summary:
I might want to revist this after @Ginsu lands his related diff.

Depends on D12493

Test Plan: Flow

Reviewers: kamil, marcin, ginsu

Subscribers: tomek, ginsu

Differential Revision: https://phab.comm.dev/D12494
  • Loading branch information
Ashoat committed Jun 20, 2024
1 parent b1968a3 commit eec930e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/shared/thread-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ type CreatePendingThreadArgs = {
+sourceMessageID?: string,
};

const defaultSubscription = {
pushNotifs: false,
home: false,
};

function createPendingThread({
viewerID,
threadType,
Expand Down Expand Up @@ -490,10 +495,7 @@ function createPendingThread({
currentUser: minimallyEncodeThreadCurrentUserInfo({
role: role.id,
permissions: membershipPermissions,
subscription: {
pushNotifs: false,
home: false,
},
subscription: defaultSubscription,
unread: false,
}),
repliesCount: 0,
Expand Down Expand Up @@ -754,10 +756,7 @@ function rawThreadInfoFromServerThreadInfo(
currentUser = {
role: null,
permissions: currentUserPermissions,
subscription: {
home: false,
pushNotifs: false,
},
subscription: defaultSubscription,
unread: null,
};
}
Expand Down

0 comments on commit eec930e

Please sign in to comment.