about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-09-18 17:26:45 +0200
committerThibaut Girka <thib@sitedethib.com>2020-09-28 17:49:55 +0200
commit14869ee656d03313882a912978e5478c628512f3 (patch)
tree02d4476231fe56d0840bf50fdbcf6ca1d1622dee /app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
parent0a069bffd9d1318f5a1b28f03afe92e96a61fdf3 (diff)
[Glitch] Add option to be notified when a followed user posts
Port 974b1b79ce58e6799e5e5bb576e630ca783150de to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js')
-rw-r--r--app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
index 225910292..90e746679 100644
--- a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
+++ b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
@@ -81,9 +81,9 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
 
   onReblogToggle (account) {
     if (account.getIn(['relationship', 'showing_reblogs'])) {
-      dispatch(followAccount(account.get('id'), false));
+      dispatch(followAccount(account.get('id'), { reblogs: false }));
     } else {
-      dispatch(followAccount(account.get('id'), true));
+      dispatch(followAccount(account.get('id'), { reblogs: true }));
     }
   },
 
@@ -95,6 +95,14 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
     }
   },
 
+  onNotifyToggle (account) {
+    if (account.getIn(['relationship', 'notifying'])) {
+      dispatch(followAccount(account.get('id'), { notify: false }));
+    } else {
+      dispatch(followAccount(account.get('id'), { notify: true }));
+    }
+  },
+
   onReport (account) {
     dispatch(initReport(account));
   },