about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/meta.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/mastodon/reducers/meta.js')
-rw-r--r--app/javascript/mastodon/reducers/meta.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/javascript/mastodon/reducers/meta.js b/app/javascript/mastodon/reducers/meta.js
new file mode 100644
index 000000000..acf6d4be1
--- /dev/null
+++ b/app/javascript/mastodon/reducers/meta.js
@@ -0,0 +1,17 @@
+import { STORE_HYDRATE } from '../actions/store';
+import Immutable from 'immutable';
+
+const initialState = Immutable.Map({
+  streaming_api_base_url: null,
+  access_token: null,
+  me: null
+});
+
+export default function meta(state = initialState, action) {
+  switch(action.type) {
+  case STORE_HYDRATE:
+    return state.merge(action.state.get('meta'));
+  default:
+    return state;
+  }
+};