kopia lustrzana https://github.com/pixelfed/pixelfed
				
				
				
			Update blocked instances view
							rodzic
							
								
									d2039ac3fd
								
							
						
					
					
						commit
						13f18d09c8
					
				|  | @ -64,23 +64,31 @@ | |||
|         }, | ||||
|       }) | ||||
|       .then(val => { | ||||
|         if (!val) throw null; | ||||
|         if (!val) { | ||||
|           swal.stopLoading(); | ||||
|           swal.close(); | ||||
|           return; | ||||
|         }; | ||||
|         try { | ||||
|           let validator = new URL(val); | ||||
|           if(!validator.hostname) throw null; | ||||
|           if(!validator.hostname || validator.protocol != 'https:') { | ||||
|             swal.stopLoading(); | ||||
|             swal.close(); | ||||
|             swal('Invalid URL', 'The URL you have entered is not valid, it must start with https://', 'error'); | ||||
|             return; | ||||
|           }; | ||||
|           axios.post(window.location.href, { | ||||
|             domain: validator.hostname | ||||
|             domain: validator.href | ||||
|           }).then(res => { | ||||
|             window.location.href = window.location.href; | ||||
|           }).catch(err => { | ||||
|             swal.stopLoading(); | ||||
|             swal.close(); | ||||
|             swal('An Error Occured', 'An error occured, please try again later.', 'error'); | ||||
|           }); | ||||
|         } catch(e) { | ||||
|           swal.stopLoading(); | ||||
|           swal.close(); | ||||
|           swal('An Error Occured', 'An error occured, please try again later.', 'error'); | ||||
|           swal('Invalid URL', 'The URL you have entered is not valid, it must start with https://', 'error'); | ||||
|         } | ||||
|       }) | ||||
|     }); | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Daniel Supernault
						Daniel Supernault