mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-25 22:04:30 +03:00
fix: fatal error on iOS Chrome
This commit is contained in:
parent
7d3ae9a0c9
commit
abdee7fac2
@ -30,7 +30,6 @@ type AppPropsWithLayout = AppProps & {
|
||||
const EmptyLayout = (page: ReactElement) => page;
|
||||
|
||||
const clientSideEmotionCache = createEmotionCache();
|
||||
const helmetContext = {};
|
||||
|
||||
const App = function App({
|
||||
Component,
|
||||
|
5
packages/env/src/index.ts
vendored
5
packages/env/src/index.ts
vendored
@ -13,6 +13,7 @@ type BrowserBase = {
|
||||
// browser special properties
|
||||
isLinux: boolean;
|
||||
isMacOs: boolean;
|
||||
isIOS: boolean;
|
||||
isSafari: boolean;
|
||||
isWindows: boolean;
|
||||
isFireFox: boolean;
|
||||
@ -83,8 +84,10 @@ export function getEnvironment() {
|
||||
isFireFox: uaHelper.isFireFox,
|
||||
isMobile: uaHelper.isMobile,
|
||||
isChrome: uaHelper.isChrome,
|
||||
isIOS: uaHelper.isIOS,
|
||||
} as Browser;
|
||||
if (environment.isChrome === true) {
|
||||
// Chrome on iOS is still Safari
|
||||
if (environment.isChrome && !environment.isIOS) {
|
||||
assertEquals(environment.isSafari, false);
|
||||
assertEquals(environment.isFireFox, false);
|
||||
environment = {
|
||||
|
2
packages/env/src/ua-helper.ts
vendored
2
packages/env/src/ua-helper.ts
vendored
@ -57,6 +57,7 @@ export function getUaHelper() {
|
||||
public isFireFox = false;
|
||||
public isMobile = false;
|
||||
public isChrome = false;
|
||||
public isIOS = false;
|
||||
|
||||
getChromeVersion = (): number => {
|
||||
const raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
|
||||
@ -81,6 +82,7 @@ export function getUaHelper() {
|
||||
this.isFireFox = this.checkUseragent('firefox');
|
||||
this.isMobile = this.checkUseragent('mobile');
|
||||
this.isChrome = this.checkUseragent('chrome');
|
||||
this.isIOS = this.checkUseragent('ios');
|
||||
}
|
||||
}
|
||||
uaHelper = new UaHelper();
|
||||
|
Loading…
Reference in New Issue
Block a user