about summary refs log tree commit diff
path: root/app/javascript/mastodon/actions/store.js
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2018-03-05 04:27:25 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-03-04 20:27:25 +0100
commit460e380d386367b6809d319859e13d17a6a2acea (patch)
treefe568a5b9e9767393c331bd4b2d96a9e2b950919 /app/javascript/mastodon/actions/store.js
parent778b37790b425debd16b73c21f0805ff2e9a4ce8 (diff)
Implement tag auto-completion by history (#6621)
This is a functionality similar to one implemented in Pawoo:
https://github.com/pixiv/mastodon/commit/21a3c70f8083b1347d2b8420ed7001b78c2c9620
Diffstat (limited to 'app/javascript/mastodon/actions/store.js')
-rw-r--r--app/javascript/mastodon/actions/store.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/javascript/mastodon/actions/store.js b/app/javascript/mastodon/actions/store.js
index a1db0fdd5..2dd94a998 100644
--- a/app/javascript/mastodon/actions/store.js
+++ b/app/javascript/mastodon/actions/store.js
@@ -1,4 +1,5 @@
 import { Iterable, fromJS } from 'immutable';
+import { hydrateCompose } from './compose';
 
 export const STORE_HYDRATE = 'STORE_HYDRATE';
 export const STORE_HYDRATE_LAZY = 'STORE_HYDRATE_LAZY';
@@ -8,10 +9,14 @@ const convertState = rawState =>
     Iterable.isIndexed(v) ? v.toList() : v.toMap());
 
 export function hydrateStore(rawState) {
-  const state = convertState(rawState);
+  return dispatch => {
+    const state = convertState(rawState);
 
-  return {
-    type: STORE_HYDRATE,
-    state,
+    dispatch({
+      type: STORE_HYDRATE,
+      state,
+    });
+
+    dispatch(hydrateCompose());
   };
 };