Fix data explorer changing pages and other actions
authorDaniel Kos <daniel.kos@contractors.roche.com>
Tue, 7 Aug 2018 12:01:30 +0000 (14:01 +0200)
committerDaniel Kos <daniel.kos@contractors.roche.com>
Tue, 7 Aug 2018 12:01:30 +0000 (14:01 +0200)
No issue #

Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos@contractors.roche.com>

src/store/data-explorer/data-explorer-middleware.ts

index 146867c3492702d62a9f518daf5449a7b2e3a679..3491862d49ce2f81d2156dbafeffdb42e0f62291 100644 (file)
@@ -8,15 +8,16 @@ import { dataExplorerActions, bindDataExplorerActions } from "./data-explorer-ac
 import { DataExplorerMiddlewareService } from "./data-explorer-middleware-service";
 
 export const dataExplorerMiddleware = (service: DataExplorerMiddlewareService): Middleware => api => next => {
-    const handleAction = <T extends { id: string }>(handler: (data: T) => void) =>
-        (data: T) => {
-            if (data.id === service.getId()) {
-                handler(data);
-            }
-        };
     const actions = bindDataExplorerActions(service.getId());
 
     return action => {
+        const handleAction = <T extends { id: string }>(handler: (data: T) => void) =>
+            (data: T) => {
+                next(action);
+                if (data.id === service.getId()) {
+                    handler(data);
+                }
+            };
         dataExplorerActions.match(action, {
             SET_PAGE: handleAction(() => {
                 api.dispatch(actions.REQUEST_ITEMS());