Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Commit 9287319

Browse files
committed
Disable service-worker sometimes
1 parent 4c9f9ef commit 9287319

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

app/js/init.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,15 @@
4545
}
4646
$.getJSON('https://telegram.org/webogram_migrate').success(function(result) {
4747
kzVersion = result.kz_version
48-
if ('K' === kzVersion || 'Z' === kzVersion) {
49-
ConfigStorage.set({
50-
kz_version: kzVersion
51-
})
52-
location.href = 'https://web.telegram.org/' + kzVersion.toLowerCase() + '/' + location.hash
53-
return
54-
} else {
55-
bootReady.migration_check = true
48+
if ('K' !== kzVersion && 'Z' !== kzVersion) {
49+
kzVersion = Math.random() >= 0.5 ? 'K' : 'Z'
5650
}
51+
ConfigStorage.set({
52+
kz_version: kzVersion
53+
})
54+
location.href = 'https://web.telegram.org/' + kzVersion.toLowerCase() + '/' + location.hash
5755
})
56+
return
5857
}
5958
var checkReady = function checkReady () {
6059
var i

app/js/offline_manager.js

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
!window.addEventListener) {
1818
return
1919
}
20+
if ('web.telegram.org' !== location.hostname ||
21+
Config.Modes.test ||
22+
Config.Modes.ios_standalone ||
23+
location.search.indexOf('legacy=1') != -1) {
24+
// procceed
25+
} else {
26+
return
27+
}
2028

2129
var declined = false
2230
function updateFound () {

0 commit comments

Comments
 (0)