saasufy-components 7.9.0 → 7.9.2

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.
Files changed (2) hide show
  1. package/app-router.js +14 -5
  2. package/package.json +2 -2
package/app-router.js CHANGED
@@ -140,6 +140,15 @@ export class AppRouter extends SocketConsumer {
140
140
  return route;
141
141
  }
142
142
 
143
+ replaceLocationHash(pagePath) {
144
+ let cleanPagePath = pagePath || '';
145
+ let firstChar = cleanPagePath.charAt(0);
146
+ if (firstChar !== '#') {
147
+ cleanPagePath = `#${cleanPagePath}`;
148
+ }
149
+ location.replace(cleanPagePath);
150
+ }
151
+
143
152
  renderCurrentPage() {
144
153
  let routerViewport = this.shadowRoot.querySelector('slot[name="viewport"]').assignedNodes()[0];
145
154
  if (!routerViewport) return;
@@ -199,7 +208,7 @@ export class AppRouter extends SocketConsumer {
199
208
  routeArgs = this.computeRouteArgs(pagePath, regExp, params);
200
209
  pagePath = this.substituteRouteAgs(authRedirect, routeArgs);
201
210
  if (hardRedirect) {
202
- location.hash = pagePath;
211
+ this.replaceLocationHash(pagePath);
203
212
  return;
204
213
  }
205
214
  let result = this.getMatchingPage(pagePath, 'auth-redirect');
@@ -211,7 +220,7 @@ export class AppRouter extends SocketConsumer {
211
220
  routeArgs = this.computeRouteArgs(pagePath, regExp, params);
212
221
  pagePath = this.substituteRouteAgs(noAuthRedirect, routeArgs);
213
222
  if (hardRedirect) {
214
- location.hash = pagePath;
223
+ this.replaceLocationHash(pagePath);
215
224
  return;
216
225
  }
217
226
  let result = this.getMatchingPage(pagePath, 'no-auth-redirect');
@@ -220,12 +229,12 @@ export class AppRouter extends SocketConsumer {
220
229
  regExp = result.regExp;
221
230
  params = result.params;
222
231
  } else {
232
+ routeArgs = this.computeRouteArgs(pagePath, regExp, params);
233
+ pagePath = this.substituteRouteAgs(redirect, routeArgs);
223
234
  if (hardRedirect) {
224
- location.hash = redirect;
235
+ this.replaceLocationHash(pagePath);
225
236
  return;
226
237
  }
227
- routeArgs = this.computeRouteArgs(pagePath, regExp, params);
228
- pagePath = this.substituteRouteAgs(redirect, routeArgs);
229
238
  let result = this.getMatchingPage(pagePath, 'redirect');
230
239
  pageTemplate = result.pageTemplate;
231
240
  route = result.route;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "7.9.0",
3
+ "version": "7.9.2",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,7 +20,7 @@
20
20
  "ag-collection": "^5.3.1",
21
21
  "ag-model": "^3.1.0",
22
22
  "capitalisk-auth-client": "^1.5.1",
23
- "socketcluster-client": "^19.2.1",
23
+ "socketcluster-client": "^19.2.3",
24
24
  "uuid": "^8.3.2"
25
25
  },
26
26
  "bugs": {