about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers/blocks.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-09-29 21:46:05 +0200
committerThibaut Girka <thib@sitedethib.com>2019-09-30 15:58:29 +0200
commit88481c965334e28615b353253380255973f4aaa5 (patch)
treea4792c8cd97d6c4503993ddb0eeed1fbac962831 /app/javascript/flavours/glitch/reducers/blocks.js
parent332be562eab78975fdbf1e928cddbe7528d93468 (diff)
[Glitch] Add explanation to mute dialog, refactor and clean up mute/block UI
Port 9027bfff0c25a6da1bcef7ce880e5d8211062d1d to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/reducers/blocks.js')
-rw-r--r--app/javascript/flavours/glitch/reducers/blocks.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/reducers/blocks.js b/app/javascript/flavours/glitch/reducers/blocks.js
new file mode 100644
index 000000000..1b6507163
--- /dev/null
+++ b/app/javascript/flavours/glitch/reducers/blocks.js
@@ -0,0 +1,22 @@
+import Immutable from 'immutable';
+
+import {
+  BLOCKS_INIT_MODAL,
+} from '../actions/blocks';
+
+const initialState = Immutable.Map({
+  new: Immutable.Map({
+    account_id: null,
+  }),
+});
+
+export default function mutes(state = initialState, action) {
+  switch (action.type) {
+  case BLOCKS_INIT_MODAL:
+    return state.withMutations((state) => {
+      state.setIn(['new', 'account_id'], action.account.get('id'));
+    });
+  default:
+    return state;
+  }
+}