0
0
Fork 0

Update devDependencies (non-major) (#28728)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renaud Chaput <renchap@gmail.com>
This commit is contained in:
renovate[bot] 2024-01-16 19:34:22 +01:00 committed by GitHub
parent e85e2929aa
commit 4e277f83dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 22 deletions

View file

@ -59,25 +59,19 @@ export const accountsReducer: Reducer<typeof initialState> = (
return normalizeAccounts(state, action.payload.accounts);
else if (followAccountSuccess.match(action)) {
return state
.update(
action.payload.relationship.id,
(account) => account?.update('followers_count', (n) => n + 1),
.update(action.payload.relationship.id, (account) =>
account?.update('followers_count', (n) => n + 1),
)
.update(
getCurrentUser(),
(account) => account?.update('following_count', (n) => n + 1),
.update(getCurrentUser(), (account) =>
account?.update('following_count', (n) => n + 1),
);
} else if (unfollowAccountSuccess.match(action))
return state
.update(
action.payload.relationship.id,
(account) =>
account?.update('followers_count', (n) => Math.max(0, n - 1)),
.update(action.payload.relationship.id, (account) =>
account?.update('followers_count', (n) => Math.max(0, n - 1)),
)
.update(
getCurrentUser(),
(account) =>
account?.update('following_count', (n) => Math.max(0, n - 1)),
.update(getCurrentUser(), (account) =>
account?.update('following_count', (n) => Math.max(0, n - 1)),
);
else return state;
};