don't show tor transport box if there is none
This commit is contained in:
		
							parent
							
								
									1bf365aff4
								
							
						
					
					
						commit
						1aea6c3362
					
				
					 2 changed files with 25 additions and 0 deletions
				
			
		|  | @ -1,3 +1,21 @@ | |||
| /* | ||||
|     Onionr - Private P2P Communication | ||||
| 
 | ||||
|     Show transport addresses | ||||
| 
 | ||||
|     This program is free software: you can redistribute it and/or modify | ||||
|     it under the terms of the GNU General Public License as published by | ||||
|     the Free Software Foundation, either version 3 of the License, or | ||||
|     (at your option) any later version. | ||||
| 
 | ||||
|     This program is distributed in the hope that it will be useful, | ||||
|     but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|     GNU General Public License for more details. | ||||
| 
 | ||||
|     You should have received a copy of the GNU General Public License | ||||
|     along with this program.  If not, see <https://www.gnu.org/licenses/>
 | ||||
| */ | ||||
| fetch('/gettoraddress', { | ||||
|     headers: { | ||||
|         "token": webpass | ||||
|  | @ -5,6 +23,11 @@ fetch('/gettoraddress', { | |||
|     .then((resp) => resp.text()) | ||||
|     .then(function(resp) { | ||||
|         let torBoxes = document.getElementsByClassName('myTor') | ||||
|         if (!resp.endsWith('.onion')){ | ||||
|             Array.from(torBoxes).forEach(element => { | ||||
|                 element.parentElement.parentElement.remove() | ||||
|             }) | ||||
|         } | ||||
|         Array.from(torBoxes).forEach(element => { | ||||
|             element.value = resp   | ||||
|         }) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue