[PM-13202][Defect] MSP name with an apostrophe displaying dummy character in Delete provider screen (#11488)
* Resolve the msp name with apostrophe * qParams.name exists and is a string before sanitization
This commit is contained in:
parent
19663d9587
commit
194aa94302
|
@ -1,4 +1,5 @@
|
|||
import { Component, OnInit } from "@angular/core";
|
||||
import { Component, OnInit, SecurityContext } from "@angular/core";
|
||||
import { DomSanitizer } from "@angular/platform-browser";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
|
||||
|
@ -24,6 +25,7 @@ export class VerifyRecoverDeleteProviderComponent implements OnInit {
|
|||
private i18nService: I18nService,
|
||||
private route: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
private sanitizer: DomSanitizer,
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
|
@ -31,7 +33,10 @@ export class VerifyRecoverDeleteProviderComponent implements OnInit {
|
|||
if (qParams.providerId != null && qParams.token != null && qParams.name != null) {
|
||||
this.providerId = qParams.providerId;
|
||||
this.token = qParams.token;
|
||||
this.name = qParams.name;
|
||||
this.name =
|
||||
qParams.name && typeof qParams.name === "string"
|
||||
? this.sanitizer.sanitize(SecurityContext.HTML, qParams.name) || ""
|
||||
: "";
|
||||
} else {
|
||||
await this.router.navigate(["/"]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue