Add alert about yesterday train feature
This commit is contained in:
		
							parent
							
								
									f1141b1e06
								
							
						
					
					
						commit
						7bd7b26256
					
				
					 2 changed files with 7 additions and 2 deletions
				
			
		
							
								
								
									
										4
									
								
								sw.js
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								sw.js
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
const VERSION = 'v11'
 | 
			
		||||
const VERSION = 'v12'
 | 
			
		||||
const API_ORIGIN = 'https://scraper.infotren.dcdev.ro/'
 | 
			
		||||
const API_TRAINS = `${API_ORIGIN}v3/trains`
 | 
			
		||||
const API_STATIONS = `${API_ORIGIN}v3/stations`
 | 
			
		||||
| 
						 | 
				
			
			@ -49,7 +49,7 @@ self.addEventListener('install', (event) => {
 | 
			
		|||
  )
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
const deleteCache = (key) => caches.delete(key)
 | 
			
		||||
const deleteCache = (/** @type {string} */ key) => caches.delete(key)
 | 
			
		||||
 | 
			
		||||
const deleteOldCaches = async () => {
 | 
			
		||||
   const cacheKeepList = [VERSION]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -489,4 +489,9 @@ window.addEventListener('load', function (e) {
 | 
			
		|||
			})
 | 
			
		||||
		}
 | 
			
		||||
	}, 500)
 | 
			
		||||
 | 
			
		||||
	if (this.localStorage && !this.localStorage.getItem('info-yesterday')) {
 | 
			
		||||
		this.alert("New feature: You can now view yesterday's train by selecting the date!")
 | 
			
		||||
		this.localStorage.setItem('info-yesterday', 'true')
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue