Skip to content

Commit

Permalink
Bugfix : #795 PathReplaceService will be executed repeatedly when use…
Browse files Browse the repository at this point in the history
… `build(String path)`
  • Loading branch information
zhi1ong committed Mar 3, 2020
1 parent 7889a37 commit 6909860
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public Postcard build(String path) {
*/
@Deprecated
public Postcard build(String path, String group) {
return _ARouter.getInstance().build(path, group);
return _ARouter.getInstance().build(path, group, false);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ protected Postcard build(String path) {
if (null != pService) {
path = pService.forString(path);
}
return build(path, extractGroup(path));
return build(path, extractGroup(path), true);
}
}

Expand All @@ -203,13 +203,15 @@ protected Postcard build(Uri uri) {
/**
* Build postcard by path and group
*/
protected Postcard build(String path, String group) {
protected Postcard build(String path, String group, Boolean afterReplace) {
if (TextUtils.isEmpty(path) || TextUtils.isEmpty(group)) {
throw new HandlerException(Consts.TAG + "Parameter is invalid!");
} else {
PathReplaceService pService = ARouter.getInstance().navigation(PathReplaceService.class);
if (null != pService) {
path = pService.forString(path);
if (!afterReplace) {
PathReplaceService pService = ARouter.getInstance().navigation(PathReplaceService.class);
if (null != pService) {
path = pService.forString(path);
}
}
return new Postcard(path, group);
}
Expand Down

0 comments on commit 6909860

Please sign in to comment.