only attempt to get URL
If it doesn't exist, it should silently fail.
This commit is contained in:
		
							parent
							
								
									5b99800c8e
								
							
						
					
					
						commit
						f5cf3f09a2
					
				
					 1 changed files with 20 additions and 12 deletions
				
			
		|  | @ -22,7 +22,14 @@ export default class filters { | |||
| 
 | ||||
| 	@param {string} URL the current URL | ||||
| 	*/ | ||||
| 	async select(URL = window.location.href) { | ||||
| 	async select(URL) { | ||||
| 		if (!URL) { | ||||
| 			try { | ||||
| 				URL = window.location.href; | ||||
| 			} catch(err) {} | ||||
| 		}; | ||||
| 
 | ||||
| 		if (URL) { | ||||
| 			let SELECTED = await (async () => { | ||||
| 				// Get the filters.
 | ||||
| 				let filter = await search(`filters`, URL, `URL`, 0.5, {"cloud": -1}); | ||||
|  | @ -35,6 +42,7 @@ export default class filters { | |||
| 				this.one = (Object.entries(SELECTED))[0][1]; | ||||
| 				return (this.one); | ||||
| 			}; | ||||
| 		} | ||||
| 	}; | ||||
| 
 | ||||
| 	/* Update all filters or just one. | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue