mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Revert "consolidate"
This reverts commit aa2f3918
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
ca78985abc
commit
daa755017e
@ -39,12 +39,15 @@ export default class WebPlatform extends VectorBasePlatform {
|
|||||||
|
|
||||||
// load service worker if available on this platform
|
// load service worker if available on this platform
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
|
// clean up old dummy sw.js
|
||||||
|
navigator.serviceWorker.getRegistration('sw.js').then(reg => reg.unregister());
|
||||||
|
|
||||||
// Service worker is disabled in webpack-dev-server: https://github.com/GoogleChrome/workbox/issues/1790
|
// Service worker is disabled in webpack-dev-server: https://github.com/GoogleChrome/workbox/issues/1790
|
||||||
if (!process.env.WEBPACK_DEV_SERVER) {
|
if (!process.env.WEBPACK_DEV_SERVER) {
|
||||||
navigator.serviceWorker.register('service-worker.js');
|
navigator.serviceWorker.register('service-worker.js');
|
||||||
} else {
|
} else {
|
||||||
// we no longer run workbox when in webpack-dev-server, clean it up
|
// we no longer run workbox when in webpack-dev-server, clean it up
|
||||||
navigator.serviceWorker.getRegistration().then(reg => reg && reg.unregister());
|
navigator.serviceWorker.getRegistration('service-worker.js').then(reg => reg.unregister());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user