[accelerator] fix redirects
This commit is contained in:
		
							parent
							
								
									96d85dcacd
								
							
						
					
					
						commit
						ada18a0413
					
				| @ -234,6 +234,10 @@ export class AccelerateCheckout implements OnInit, OnDestroy { | |||||||
|                 } |                 } | ||||||
|                 setTimeout(() => { |                 setTimeout(() => { | ||||||
|                   that.closeModal(); |                   that.closeModal(); | ||||||
|  |                   if (window.history.replaceState) { | ||||||
|  |                     const urlParams = new URLSearchParams(window.location.search); | ||||||
|  |                     window.history.replaceState(null, null, window.location.toString().replace(`?cash_request_id=${urlParams.get('cash_request_id')}`, '')); | ||||||
|  |                   } | ||||||
|                 }, 1000); |                 }, 1000); | ||||||
|               }, |               }, | ||||||
|               error: (response) => { |               error: (response) => { | ||||||
| @ -242,6 +246,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { | |||||||
|                 } else { |                 } else { | ||||||
|                   that.error = response.error; |                   that.error = response.error; | ||||||
|                   setTimeout(() => { |                   setTimeout(() => { | ||||||
|  |                     // Reset everything by reloading the page :D, can be improved
 | ||||||
|                     const urlParams = new URLSearchParams(window.location.search); |                     const urlParams = new URLSearchParams(window.location.search); | ||||||
|                     window.location.assign(window.location.toString().replace(`?cash_request_id=${urlParams.get('cash_request_id')}`, ``)); |                     window.location.assign(window.location.toString().replace(`?cash_request_id=${urlParams.get('cash_request_id')}`, ``)); | ||||||
|                   }, 3000); |                   }, 3000); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user