Browse Source

Build

master
Eduard Kuzmenko 2 years ago
parent
commit
b48bc7610d
  1. 4
      .env
  2. 5
      src/lib/serviceWorker/index.service.ts

4
.env

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
API_ID=1025907
API_HASH=452b0359b988148995f22ff0f4229750
VERSION=1.4.1
VERSION_FULL=1.4.1 (159)
BUILD=159
VERSION_FULL=1.4.1 (160)
BUILD=160

5
src/lib/serviceWorker/index.service.ts

@ -20,6 +20,7 @@ import { CACHE_ASSETS_NAME, requestCache } from './cache'; @@ -20,6 +20,7 @@ import { CACHE_ASSETS_NAME, requestCache } from './cache';
import onStreamFetch from './stream';
import { closeAllNotifications, onPing } from './push';
import CacheStorageController from '../cacheStorage';
import { IS_SAFARI } from '../../environment/userAgent';
export const log = logger('SW', LogTypes.Error | LogTypes.Debug | LogTypes.Log | LogTypes.Warn);
const ctx = self as any as ServiceWorkerGlobalScope;
@ -113,7 +114,9 @@ export function incrementTaskId() { @@ -113,7 +114,9 @@ export function incrementTaskId() {
} */
const onFetch = (event: FetchEvent): void => {
if(event.request.url.indexOf(location.origin + '/') === 0 && event.request.url.match(/\.(js|css|jpe?g|json|wasm|png|mp3|svg|tgs|ico|woff2?|ttf|webmanifest?)(?:\?.*)?$/)) {
if(event.request.url.indexOf(location.origin + '/') === 0
&& event.request.url.match(/\.(js|css|jpe?g|json|wasm|png|mp3|svg|tgs|ico|woff2?|ttf|webmanifest?)(?:\?.*)?$/)
&& !IS_SAFARI) {
return event.respondWith(requestCache(event));
}

Loading…
Cancel
Save