esoftplay 0.0.239 → 0.0.240
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/modules/lib/navigation.ts +12 -12
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// noPage
|
|
2
2
|
// withObject
|
|
3
|
-
import { StackActions } from '@react-navigation/native';
|
|
3
|
+
import { CommonActions, StackActions } from '@react-navigation/native';
|
|
4
4
|
import { LibNavigationRoutes } from 'esoftplay';
|
|
5
5
|
import { EspArgsInterface } from 'esoftplay/cache/args';
|
|
6
6
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
7
7
|
import { EspRouterInterface } from 'esoftplay/cache/routers';
|
|
8
|
+
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
8
9
|
import { UserRoutes } from 'esoftplay/cache/user/routes/import';
|
|
9
10
|
|
|
10
11
|
import esp from 'esoftplay/esp';
|
|
@@ -194,17 +195,16 @@ export default {
|
|
|
194
195
|
},
|
|
195
196
|
/** Klik [disini](https://github.com/dev-esoftplay/mobile-docs/blob/main/modules/lib/navigation.md#reset) untuk melihat dokumentasi*/
|
|
196
197
|
reset(route?: LibNavigationRoutes, ...routes: LibNavigationRoutes[]): void {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
// this._ref?.dispatch?.(resetAction);
|
|
198
|
+
const user = UserClass.state().get()
|
|
199
|
+
let _route = [route || esp.config('home', (user && (user.id || user.user_id || user.apikey)) ? 'member' : 'public')]
|
|
200
|
+
if (routes && routes.length > 0) {
|
|
201
|
+
_route = [..._route, ...routes]
|
|
202
|
+
}
|
|
203
|
+
const resetAction = CommonActions.reset({
|
|
204
|
+
index: _route.length - 1,
|
|
205
|
+
routes: _route.map((rn) => ({ name: rn }))
|
|
206
|
+
});
|
|
207
|
+
this._ref?.dispatch?.(resetAction);
|
|
208
208
|
},
|
|
209
209
|
/** Klik [disini](https://github.com/dev-esoftplay/mobile-docs/blob/main/modules/lib/navigation.md#back) untuk melihat dokumentasi*/
|
|
210
210
|
back(deep?: number): void {
|