From 8c10812a914d1da705e26a86d09899a77e5be39a Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Sun, 9 Feb 2014 19:52:38 +0330 Subject: [PATCH] Update check --- Web/cache.appcache | 4 ++-- Web/js/main.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Web/cache.appcache b/Web/cache.appcache index 9574394..996dcf0 100644 --- a/Web/cache.appcache +++ b/Web/cache.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST index.html -js/ -css/ +js +css diff --git a/Web/js/main.js b/Web/js/main.js index 7efd1a2..8b294e4 100644 --- a/Web/js/main.js +++ b/Web/js/main.js @@ -89,9 +89,10 @@ $(document).ready(function() { // Check for Update - var request = navigator.mozApps.checkInstalled('mdibaiee.github.io/Sketchy/Web/manifest-web.webapp'); + var request = navigator.mozApps.getInstalled(); request.onsuccess = function() { - if( !this.result && confirm('A new version is available, do you want to update?') ) { + var app = this.result[0]; + if( !app && confirm('A new version is available, do you want to update?') ) { var ins = navigator.mozApps.install('mdibaiee.github.io/Sketchy/Web/manifest-web.webapp'); ins.onsuccess = function() { alert('The app was installed successfuly');