master: change repo

This commit is contained in:
Julien Calixte
2019-08-22 11:50:32 +02:00
commit dbd63d341c
263 changed files with 26153 additions and 0 deletions

21
src/utils/network.ts Normal file
View File

@@ -0,0 +1,21 @@
declare var navigator: any
export const hasGoodNetwork = (): boolean => {
const connection =
navigator.connection ||
navigator.mozConnection ||
navigator.webkitConnection
if (connection) {
if (connection.effectiveType) {
const goodNetworks: string[] = ['3g', '4g']
return goodNetworks.includes(connection.effectiveType)
} else {
const highBandwidth: boolean =
connection.metered && (connection.bandwidth || 0) > 2
return highBandwidth
}
}
return true
}