Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-04-13 17:53:15 +03:00
parent 3ac881c3aa
commit 372cb1d582
2 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,6 @@ CACHE MANIFEST
# Last Modified: 2017 Apr 13 # Last Modified: 2017 Apr 13
CACHE: CACHE:
simplesnake.html
simplesnake.css simplesnake.css
simplesnake.js simplesnake.js
simplesnake.html

View File

@ -379,9 +379,12 @@ function setup(snake, timer, size){
if(window.applicationCache){ if(window.applicationCache){
applicationCache.update() applicationCache.update()
applicationCache.addEventListener('updateready', function(){
if(applicationCache.status == applicationCache.UPDATEREADY){ if(applicationCache.status == applicationCache.UPDATEREADY){
console.log('NEW VERSION') console.log('NEW VERSION')
applicationCache.swapCache() applicationCache.swapCache()
location.reload()
}
} }
} }
} }