From 9c2cd4d13e0c3686e69cbaff1a2c65a5a365581b Mon Sep 17 00:00:00 2001 From: "Davis Z. Cabral" Date: Thu, 6 Sep 2018 14:01:57 -0300 Subject: [PATCH] Allow push/jump to also refresh --- src/navigationStore.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/navigationStore.js b/src/navigationStore.js index cefa41922..7f9ab6c04 100644 --- a/src/navigationStore.js +++ b/src/navigationStore.js @@ -866,13 +866,19 @@ class NavigationStore { }; push = (routeName, data) => { - const params = filterParam(data); + const { refresh, ...params } = filterParam(data); this.dispatch({ type: StackActions.PUSH, routeName, params }); + if (refresh) { + this.refresh(refresh); + } }; jump = (routeName, data) => { - const params = filterParam(data); + const { refresh, ...params } = filterParam(data); this.dispatch({ type: NavigationActions.NAVIGATE, routeName, params }); + if (refresh) { + this.refresh(refresh); + } }; drawerOpen = () => {