Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
itamarshubin committed Mar 18, 2024
1 parent 4b1ce50 commit 9163f62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/constants/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export const removeAlertSubscription = async (msg: Message) => {
if (!sessionedRemoveSubscribersAlert[msg.from]) {
const userRef = await getUserRef(msg);

const followersRef: DocumentReference<User>[] =
userRef.data().subscribedUsers;
const followersRef: DocumentReference<User>[] = userRef.data().subscribedTo;
const followers = await Promise.all(
followersRef.map((followerRef) => getDocFromServer(followerRef))
);
Expand Down Expand Up @@ -166,6 +165,7 @@ export const createAlertSubscription = async (msg: Message) => {
);
}
await updateDoc(userToAdd.ref, { subscribedUsers: arrayUnion(userRef.ref) });
await updateDoc(userRef.ref, { subscribedTo: arrayUnion(userToAdd.ref) });
client.sendMessage(
msg.from,
`תקבל הודעה כש${userToAdd.data().name} יעדכן על מצב ההגעה שלו`
Expand Down

0 comments on commit 9163f62

Please sign in to comment.