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