diff options
author | ThibG <thib@sitedethib.com> | 2020-05-29 16:14:16 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-05-29 20:02:30 +0200 |
commit | 9bd30b8dd563d1c7066060ccfa456ea350a7fb01 (patch) | |
tree | 5dde72cb0d891a2c470cc5ad6323b017ebc76b03 /app/javascript/flavours/glitch/reducers | |
parent | 60b43050cb01075248958c7d71586e6a2a312c04 (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')
-rw-r--r-- | app/javascript/flavours/glitch/reducers/index.js | 2 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/reducers/markers.js | 25 |
2 files changed, 27 insertions, 0 deletions
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; + } +}; |