@@ -886,10 +886,15 @@ export class AppComponent implements OnInit {
886886
887887 let pageUrl = 'conversation-detail/'
888888 if ( IDConv && FullNameConv ) {
889- pageUrl += IDConv + '/' + FullNameConv + '/' + Convtype
889+ pageUrl += IDConv + '/' + encodeURIComponent ( FullNameConv ) + '/' + Convtype
890890 }
891+
892+ const queryParams = this . route . snapshot . queryParams ;
893+ const queryString = new URLSearchParams ( queryParams ) . toString ( ) ;
894+ pageUrl += queryString ? `?${ queryString } ` : '' ;
895+
891896 // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
892- this . router . navigateByUrl ( pageUrl . replace ( / \( / g, '%28' ) . replace ( / \) / g, '%29' ) . replace ( / # / g , "%23" ) ) ;
897+ this . router . navigateByUrl ( pageUrl . replace ( / \( / g, '%28' ) . replace ( / \) / g, '%29' ) ) ;
893898
894899
895900 // const DASHBOARD_URL = this.appConfigProvider.getConfig().DASHBOARD_URL;
@@ -1299,7 +1304,7 @@ export class AppComponent implements OnInit {
12991304 subscribeChangedConversationSelected = ( user : UserModel , type : string ) => {
13001305 this . logger . log ( '[APP-COMP] subscribeUidConvSelectedChanged navigateByUrl' , user , type ) ;
13011306 // this.router.navigateByUrl('conversation-detail/' + user.uid + '?conversationWithFullname=' + user.fullname);
1302- this . router . navigateByUrl ( 'conversation-detail/' + user . uid + '/' + user . fullname + '/' + type ) ;
1307+ this . router . navigateByUrl ( 'conversation-detail/' + user . uid + '/' + encodeURIComponent ( user . fullname ) + '/' + type ) ;
13031308 }
13041309
13051310 subscribeProfileInfoButtonLogOut = ( hasClickedLogout ) => {
@@ -1471,10 +1476,10 @@ export class AppComponent implements OnInit {
14711476 let Convtype = 'active'
14721477
14731478 if ( IDConv && FullNameConv ) {
1474- pageUrl += IDConv + '/' + FullNameConv + '/' + Convtype
1479+ pageUrl += IDConv + '/' + encodeURIComponent ( FullNameConv ) + '/' + Convtype
14751480 }
14761481 // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
1477- this . router . navigateByUrl ( pageUrl . replace ( / \( / g, '%28' ) . replace ( / \) / g, '%29' ) . replace ( / # / g , "%23" ) ) ;
1482+ this . router . navigateByUrl ( pageUrl . replace ( / \( / g, '%28' ) . replace ( / \) / g, '%29' ) ) ;
14781483 } else {
14791484 console . log ( "FCM: Received in foreground" , JSON . stringify ( data ) ) ;
14801485 // let IDConv = data.recipient
@@ -1485,7 +1490,7 @@ export class AppComponent implements OnInit {
14851490 // pageUrl += IDConv + '/' + FullNameConv + '/' + Convtype
14861491 // }
14871492 // // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
1488- // this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ) );
1493+ // this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'));
14891494 } ;
14901495 } ) ;
14911496 }
0 commit comments