Skip to content

Commit

Permalink
#338 - Error using non hash navigation while reloading - fixed (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHossfeld authored Sep 4, 2023
1 parent ef6896a commit cd4234a
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,13 @@ public static NaluStartModel getNaluStartModel() {
// in case we need to remove the parameter, update history ...
if (PropertyFactory.INSTANCE.isRemoveUrlParameterAtStart()) {
if (!queryParameters.isEmpty()) {
String href = location.href;
String newUrl;
if (href.contains("?")) {
newUrl = href.substring(0,
href.indexOf("?"));
if (startRoute != null) {
if (!startRoute.isEmpty()) {
newUrl = newUrl + "#" + startRoute;
String newUrl = null;
if (startRoute != null) {
if (location.href.contains("?")) {
if (PropertyFactory.INSTANCE.isUsingHash()) {
newUrl = location.origin + location.pathname + "#" + startRoute;
} else {
newUrl = location.origin + "/" + startRoute;
}
}
DomGlobal.window.history.replaceState(newUrl,
Expand Down Expand Up @@ -175,8 +174,6 @@ public static void addPopStateHandler(RouteChangeHandler handler,
if (Objects.isNull(newUrl) ||
newUrl.trim()
.isEmpty()) {
// newUrl = PropertyFactory.INSTANCE
// .getStartRoute();
return null;
}
}
Expand Down

0 comments on commit cd4234a

Please sign in to comment.