From 9bd30b8dd563d1c7066060ccfa456ea350a7fb01 Mon Sep 17 00:00:00 2001 From: ThibG Date: Fri, 29 May 2020 16:14:16 +0200 Subject: [Glitch] Fix timeline markers not working on Chrome Port 5aff2a6957e861162d67c4610277e9bb2a6f8186 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/reducers/index.js | 2 ++ app/javascript/flavours/glitch/reducers/markers.js | 25 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 app/javascript/flavours/glitch/reducers/markers.js (limited to 'app/javascript/flavours/glitch/reducers') diff --git a/app/javascript/flavours/glitch/reducers/index.js b/app/javascript/flavours/glitch/reducers/index.js index 586b84749..852abe9dd 100644 --- a/app/javascript/flavours/glitch/reducers/index.js +++ b/app/javascript/flavours/glitch/reducers/index.js @@ -36,6 +36,7 @@ import polls from './polls'; import identity_proofs from './identity_proofs'; import trends from './trends'; import announcements from './announcements'; +import markers from './markers'; const reducers = { announcements, @@ -75,6 +76,7 @@ const reducers = { pinnedAccountsEditor, polls, trends, + markers, }; export default combineReducers(reducers); 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; + } +}; -- cgit