about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers/meta.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-07-05 02:41:40 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-07-05 11:35:32 +0200
commit30e7836a1961e8e70938b14232abd91238eb2be4 (patch)
treea2a6e9ae21cc848e1bbb29062ce63ecdbebafcae /app/javascript/flavours/glitch/reducers/meta.js
parent92c06a111397e7f9da44db9942f61fd06e03b557 (diff)
[Glitch] Add customizable user roles
Port front-end changes from 44b2ee3485ba0845e5910cefcb4b1e2f84f34470 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/reducers/meta.js')
-rw-r--r--app/javascript/flavours/glitch/reducers/meta.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/reducers/meta.js b/app/javascript/flavours/glitch/reducers/meta.js
index a98dc436a..0f3ab3b84 100644
--- a/app/javascript/flavours/glitch/reducers/meta.js
+++ b/app/javascript/flavours/glitch/reducers/meta.js
@@ -4,12 +4,13 @@ import { Map as ImmutableMap } from 'immutable';
 const initialState = ImmutableMap({
   streaming_api_base_url: null,
   access_token: null,
+  permissions: '0',
 });
 
 export default function meta(state = initialState, action) {
   switch(action.type) {
   case STORE_HYDRATE:
-    return state.merge(action.state.get('meta'));
+    return state.merge(action.state.get('meta')).set('permissions', action.state.getIn(['role', 'permissions']));
   default:
     return state;
   }