Slight simplification
This commit is contained in:
parent
12ae68f45e
commit
12bbc525dc
|
@ -84,8 +84,7 @@ const User: Component<Props> = (props) => {
|
|||
return false;
|
||||
};
|
||||
|
||||
const addSubscriptionFactory =
|
||||
(username: string) => (userDocument: any) => {
|
||||
const addSubscription = (userDocument: any) => {
|
||||
const subscriptions = userDocument.subscriptions || [];
|
||||
subscriptions.push({ username, direction: '' });
|
||||
userDocument.subscriptions = subscriptions;
|
||||
|
@ -101,7 +100,7 @@ const User: Component<Props> = (props) => {
|
|||
if (!isIn(subscription.username, subscriptions)) {
|
||||
update(
|
||||
userId(subscription.username, database),
|
||||
addSubscriptionFactory(username),
|
||||
addSubscription,
|
||||
defaultUserDocument
|
||||
);
|
||||
console.log({
|
||||
|
|
Loading…
Reference in New Issue