Skip to content

Commit

Permalink
Merge pull request #1658 from FreeFeed/notify-on-commented-posts
Browse files Browse the repository at this point in the history
On/off notifications for new comments on the posts commented on
  • Loading branch information
davidmz authored Dec 7, 2023
2 parents 5aab7b6 + 20241e3 commit dbb9ef7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.126.0] - Not released
### Added
- User can now turn on/off notifications for new comments on the posts they
commented on.

## [1.125.1] - 2023-11-24
### Fixed
Expand Down
10 changes: 10 additions & 0 deletions src/components/settings/forms/notifications.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function NotificationsForm() {
const sendDailyBestOfDigest = useField('sendDailyBestOfDigest', form.form);
const sendWeeklyBestOfDigest = useField('sendWeeklyBestOfDigest', form.form);
const notifyOfCommentsOnMyPosts = useField('notifyOfCommentsOnMyPosts', form.form);
const notifyOfCommentsOnCommentedPosts = useField('notifyOfCommentsOnCommentedPosts', form.form);

return (
<form onSubmit={form.handleSubmit}>
Expand All @@ -47,6 +48,12 @@ export default function NotificationsForm() {
Notify me about all new comments on my posts
</label>
</div>
<div className="checkbox">
<label>
<CheckboxInput field={notifyOfCommentsOnCommentedPosts} />
Notify me about all new comments on posts I comment on
</label>
</div>
<p className="help-block">
You will still be able to turn off notifications for a specific post using the More
menu.
Expand Down Expand Up @@ -127,6 +134,7 @@ function initialValues({ frontendPreferences, preferences }) {
sendDailyBestOfDigest: preferences.sendDailyBestOfDigest,
sendWeeklyBestOfDigest: preferences.sendWeeklyBestOfDigest,
notifyOfCommentsOnMyPosts: preferences.notifyOfCommentsOnMyPosts,
notifyOfCommentsOnCommentedPosts: preferences.notifyOfCommentsOnCommentedPosts,
};
}

Expand All @@ -137,6 +145,7 @@ function onSubmit(userData, dispatch) {
sendDailyBestOfDigest,
sendWeeklyBestOfDigest,
notifyOfCommentsOnMyPosts,
notifyOfCommentsOnCommentedPosts,
}) =>
doSequence(dispatch)(
(dispatch) =>
Expand All @@ -154,6 +163,7 @@ function onSubmit(userData, dispatch) {
sendDailyBestOfDigest,
sendWeeklyBestOfDigest,
notifyOfCommentsOnMyPosts,
notifyOfCommentsOnCommentedPosts,
}),
);
},
Expand Down

0 comments on commit dbb9ef7

Please sign in to comment.