From 61761effe44e797e1662496b96b802dbba47ddc5 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Mon, 14 Jun 2021 17:18:51 +0300 Subject: [PATCH] Fix manifest path Fix Safari 304 Not Modified --- src/components/sidebarLeft/index.ts | 2 +- src/config/app.ts | 2 +- src/index.hbs | 4 ++-- src/lang.ts | 2 +- src/lib/mtproto/mtproto.service.ts | 9 ++++++++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/sidebarLeft/index.ts b/src/components/sidebarLeft/index.ts index 60968da8..4bba3eac 100644 --- a/src/components/sidebarLeft/index.ts +++ b/src/components/sidebarLeft/index.ts @@ -178,7 +178,7 @@ export class AppSidebarLeft extends SidebarSlider { icon: 'char w', text: 'ChatList.Menu.SwitchTo.Webogram', onClick: () => { - location.href = 'https://web.telegram.org/'; + location.href = 'https://web.telegram.org/?legacy=1'; }, verify: () => App.isMainDomain }]; diff --git a/src/config/app.ts b/src/config/app.ts index bf47a116..a5cf0e99 100644 --- a/src/config/app.ts +++ b/src/config/app.ts @@ -13,7 +13,7 @@ const App = { id: 1025907, hash: '452b0359b988148995f22ff0f4229750', version: '0.5.6', - langPackVersion: '0.2.1', + langPackVersion: '0.2.2', langPack: 'macos', langPackCode: 'en', domains: [] as string[], diff --git a/src/index.hbs b/src/index.hbs index c70bedcf..3ef58c68 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -13,14 +13,14 @@ - + - + {{# each htmlWebpackPlugin.files.css }} diff --git a/src/lang.ts b/src/lang.ts index 2ed68935..7155492d 100644 --- a/src/lang.ts +++ b/src/lang.ts @@ -43,7 +43,7 @@ const lang = { "Chat.Search.NoMessagesFound": "No messages found", "Chat.Search.PrivateSearch": "Private Search", //"ChatList.Menu.Archived": "Archived", - "ChatList.Menu.SwitchTo.Webogram": "Switch to Webogram", + "ChatList.Menu.SwitchTo.Webogram": "Switch to Old Version", "ChatList.Menu.SwitchTo.Z": "Switch to Z version", "ConnectionStatus.ReconnectIn": "Reconnect in %ds, %s", "ConnectionStatus.Reconnect": "reconnect", diff --git a/src/lib/mtproto/mtproto.service.ts b/src/lib/mtproto/mtproto.service.ts index b61c7667..4d6fbe35 100644 --- a/src/lib/mtproto/mtproto.service.ts +++ b/src/lib/mtproto/mtproto.service.ts @@ -63,9 +63,16 @@ async function requestCache(event: FetchEvent) { return file; } - const response = await fetch(event.request); + let response = await fetch(event.request); if(isCorrectResponse(response)) { cache.put(event.request, response.clone()); + } else if(response.status === 304) { // possible fix for 304 in Safari + const url = event.request.url.replace(/\?.+$/, '') + '?' + (Math.random() * 100000 | 0); + const request = new Request(url); + response = await fetch(request); + if(isCorrectResponse(response)) { + cache.put(request, response.clone()); + } } return response;