about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers/markers.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-05-29 16:14:16 +0200
committerThibaut Girka <thib@sitedethib.com>2020-05-29 20:02:30 +0200
commit9bd30b8dd563d1c7066060ccfa456ea350a7fb01 (patch)
tree5dde72cb0d891a2c470cc5ad6323b017ebc76b03 /app/javascript/flavours/glitch/reducers/markers.js
parent60b43050cb01075248958c7d71586e6a2a312c04 (diff)
[Glitch] Fix timeline markers not working on Chrome
Port 5aff2a6957e861162d67c4610277e9bb2a6f8186 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/reducers/markers.js')
-rw-r--r--app/javascript/flavours/glitch/reducers/markers.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/reducers/markers.js b/app/javascript/flavours/glitch/reducers/markers.js
new file mode 100644
index 000000000..2e67be82e
--- /dev/null
+++ b/app/javascript/flavours/glitch/reducers/markers.js
@@ -0,0 +1,25 @@
+import {
+  MARKERS_SUBMIT_SUCCESS,
+} from '../actions/notifications';
+
+const initialState = ImmutableMap({
+  home: '0',
+  notifications: '0',
+});
+
+import { Map as ImmutableMap } from 'immutable';
+
+export default function markers(state = initialState, action) {
+  switch(action.type) {
+  case MARKERS_SUBMIT_SUCCESS:
+    if (action.home) {
+      state = state.set('home', action.home);
+    }
+    if (action.notifications) {
+      state = state.set('notifications', action.notifications);
+    }
+    return state;
+  default:
+    return state;
+  }
+};