update the URL record only when it exists
This commit is contained in:
		
							parent
							
								
									2ca43d5995
								
							
						
					
					
						commit
						35663a3ed7
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		|  | @ -32,14 +32,17 @@ class Page_Results extends Page { | |||
|      */ | ||||
|      async update(override = false) { | ||||
|           // Set the reference website when overriding or unset. 
 | ||||
| 		if (override || !this[`ref`]) {this[`ref`] = await global.read([`last`])}; | ||||
| 		if (override || !this[`ref`]) { | ||||
|                let RECORD = await global.read([`last`]); | ||||
|                (RECORD) ? this[`ref`] = RECORD : false; | ||||
|           }; | ||||
|            | ||||
|           if (this[`ref`]) { | ||||
|                // Get all the data. 
 | ||||
|                let DATA = { | ||||
|                     "data": await global.read([`sites`, this[`ref`]]) | ||||
|                } | ||||
|       | ||||
|                 | ||||
|                // Set the data. 
 | ||||
|                this[`data`] = (DATA[`data`] && (typeof DATA[`data`]).includes(`obj`)) ? DATA[`data`] : (this[`data`] ? this[`data`] : {}); | ||||
|           } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue