🏷 bring back Navigator.connection type to fix tsc error temporary
This commit is contained in:
parent
96d2e57f73
commit
e9e492ba8e
|
|
@ -125,7 +125,7 @@
|
||||||
"prettier": "^2.1.2",
|
"prettier": "^2.1.2",
|
||||||
"rimraf": "^3.0.0",
|
"rimraf": "^3.0.0",
|
||||||
"ts-jest": "^25.2.1",
|
"ts-jest": "^25.2.1",
|
||||||
"typescript": "^4.1.2",
|
"typescript": "^4.8.2",
|
||||||
"umi-plugin-hire": "^1.0.3"
|
"umi-plugin-hire": "^1.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,16 @@ const requestIdleCallback =
|
||||||
}, 1);
|
}, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Navigator {
|
||||||
|
connection: {
|
||||||
|
saveData: boolean;
|
||||||
|
effectiveType: string;
|
||||||
|
type: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | 'unknown';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const isSlowNetwork = navigator.connection
|
const isSlowNetwork = navigator.connection
|
||||||
? navigator.connection.saveData ||
|
? navigator.connection.saveData ||
|
||||||
(navigator.connection.type !== 'wifi' &&
|
(navigator.connection.type !== 'wifi' &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user