Progress bar not showing on some pages
This commit is contained in:
		
							
								
								
									
										33
									
								
								resources/assets/js/bootstrap.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										33
									
								
								resources/assets/js/bootstrap.js
									
									
									
									
										vendored
									
									
								
							| @@ -19,6 +19,38 @@ window.axios.defaults.headers.common['X-CSRF-TOKEN'] = window.Laravel.csrfToken; | ||||
| window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; | ||||
| window.axios.defaults.headers.common['Content-Type'] = 'multipart/form-data'; | ||||
|  | ||||
|  | ||||
| // #start NProgress integration | ||||
| // Added nprogress to use nprogress bar | ||||
| import NProgress from "nprogress"; | ||||
|  | ||||
| window.axios.interceptors.request.use(function (config) { | ||||
|     // Do something before request is sent | ||||
|     NProgress.start(); | ||||
|  | ||||
|     return config; | ||||
| }, function (error) { | ||||
|     // Do something with request error | ||||
|     console.log(error); | ||||
|  | ||||
|     return Promise.reject(error); | ||||
| }); | ||||
|  | ||||
| // Add a response interceptor | ||||
| window.axios.interceptors.response.use(function (response) { | ||||
|     // Do something with response data | ||||
|     NProgress.done(); | ||||
|  | ||||
|     return response; | ||||
| }, function (error) { | ||||
|     NProgress.done(); | ||||
|     // Do something with response error | ||||
|     console.log(error); | ||||
|  | ||||
|     return Promise.reject(error); | ||||
| }); | ||||
| // #end NProgress integration | ||||
|  | ||||
| /** | ||||
|  * Echo exposes an expressive API for subscribing to channels and listening | ||||
|  * for events that are broadcast by Laravel. Echo and event broadcasting | ||||
| @@ -33,3 +65,4 @@ window.axios.defaults.headers.common['Content-Type'] = 'multipart/form-data'; | ||||
| //     broadcaster: 'pusher', | ||||
| //     key: 'your-pusher-key' | ||||
| // }); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user