about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers
diff options
context:
space:
mode:
authorOSAMU SATO <satosamu@gmail.com>2020-10-13 08:01:14 +0900
committerThibaut Girka <thib@sitedethib.com>2020-10-21 21:28:47 +0200
commit78ad04420c589479a042723a502bf5838f2ef3d4 (patch)
treecf3e752eee866fe377e202c3b014ba13bb650dc6 /app/javascript/flavours/glitch/reducers
parent813c84cd6cf5511270f630e91377a12ce41cd28b (diff)
[Glitch] Add duration parameter to muting.
Port 96761752eccfc0d239974a24e0cc2d74c6aee7ac to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/reducers')
-rw-r--r--app/javascript/flavours/glitch/reducers/mutes.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/reducers/mutes.js b/app/javascript/flavours/glitch/reducers/mutes.js
index 7111bb710..d346d9a78 100644
--- a/app/javascript/flavours/glitch/reducers/mutes.js
+++ b/app/javascript/flavours/glitch/reducers/mutes.js
@@ -3,12 +3,14 @@ import Immutable from 'immutable';
 import {
   MUTES_INIT_MODAL,
   MUTES_TOGGLE_HIDE_NOTIFICATIONS,
+  MUTES_CHANGE_DURATION,
 } from 'flavours/glitch/actions/mutes';
 
 const initialState = Immutable.Map({
   new: Immutable.Map({
     account: null,
     notifications: true,
+    duration: 0,
   }),
 });
 
@@ -21,6 +23,8 @@ export default function mutes(state = initialState, action) {
     });
   case MUTES_TOGGLE_HIDE_NOTIFICATIONS:
     return state.updateIn(['new', 'notifications'], (old) => !old);
+  case MUTES_CHANGE_DURATION:
+    return state.setIn(['new', 'duration'], Number(action.duration));
   default:
     return state;
   }