mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-12 03:10:03 +01:00
Expand out offline app features for smoother cache clearing and version tracking (#1384)
* Add version number to bottom * Get latest version number from GitHub * Create versionManagement.js Fetching the latest and local version number is now done through versionManagement.js * Add popup to prompt for refresh when a new version is available A new version is available whenever the sw.js file is changed. * Add version number fixed in top right corner * Fix Codeclimate issues * Update versionManagement.js * Update versionManagement.js * Make update prompt appear at front of page Changed z-index * Delete unecessary code * Create task to automatically update sw.js Used grunt-text-replace * Uninstall semver * Add replace task to serve and production tasks * Update demo.js Make version statements more descriptive. * Update versionManagement.js Remove unused versionCompare function * Change URL for getting latest version Changed the URL for getting the latest NPM version to be based on the package.json file's attribute for "homepage". * Update index.html * Update demo.css * Added explanatory comments * Update versionManagement.js * Update versionManagement.js * Updates for readability Changed single-line comments to multiline comments. * Update versionManagement.js * Update versionManagement.js Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com> Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
This commit is contained in:
committed by
Jeffrey Warren
parent
ab793bcf4e
commit
00ed0f148d
@@ -1,5 +1,4 @@
|
||||
const staticCacheName = 'image-sequencer-static-v3';
|
||||
|
||||
const staticCacheName = 'image-sequencer-static-v3.5.1';
|
||||
self.addEventListener('install', event => {
|
||||
console.log('Attempting to install service worker');
|
||||
});
|
||||
@@ -33,3 +32,10 @@ self.addEventListener('fetch', function(event) {
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
// When the update modal sends a 'skipWaiting' message, call the skipWaiting method.
|
||||
self.addEventListener('message', function(event) {
|
||||
if(event.data.action === 'skipWaiting') {
|
||||
self.skipWaiting();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user