Browse Source

Fixed decoder state params

pull/3355/head
Vladyslav Prykhodko 6 years ago
parent
commit
5900479c40
  1. 2
      ui-ngx/src/app/core/utils.ts
  2. 4
      ui-ngx/src/app/modules/home/pages/dashboard/states/state-controller.component.ts

2
ui-ngx/src/app/core/utils.ts

@ -175,7 +175,7 @@ export function objToBase64URI(obj: any): string {
}
export function base64toObj(b64Encoded: string): any {
const json = decodeURIComponent(atob(decodeURIComponent(b64Encoded)).split('').map((c) => {
const json = decodeURIComponent(atob(b64Encoded).split('').map((c) => {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
return JSON.parse(json);

4
ui-ngx/src/app/modules/home/pages/dashboard/states/state-controller.component.ts

@ -100,7 +100,7 @@ export abstract class StateControllerComponent implements IStateControllerCompon
this.rxSubscriptions.push(this.route.queryParamMap.subscribe((paramMap) => {
const dashboardId = this.route.snapshot.params.dashboardId;
if (this.dashboardId === dashboardId) {
const newState = paramMap.get('state');
const newState = decodeURIComponent(paramMap.get('state'));
if (this.currentState !== newState) {
this.currentState = newState;
if (this.inited) {
@ -147,7 +147,7 @@ export abstract class StateControllerComponent implements IStateControllerCompon
}
public reInit() {
this.currentState = this.route.snapshot.queryParamMap.get('state');
this.currentState = decodeURIComponent(this.route.snapshot.queryParamMap.get('state'));
this.init();
}

Loading…
Cancel
Save