Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: fatal error on iOS Chrome

himself65abdee7fac268
diff --git a/apps/web/src/pages/_app.tsx b/apps/web/src/pages/_app.tsx
index d1ff9c7196..04243deab9 100644
--- a/apps/web/src/pages/_app.tsx
+++ b/apps/web/src/pages/_app.tsx
@@ -30,7 +30,6 @@ type AppPropsWithLayout = AppProps & {
const EmptyLayout = (page: ReactElement) => page;
const clientSideEmotionCache = createEmotionCache();
-const helmetContext = {};
const App = function App({
Component,
diff --git a/packages/env/src/index.ts b/packages/env/src/index.ts
index 62cc584b26..5ec1c4d116 100644
--- a/packages/env/src/index.ts
+++ b/packages/env/src/index.ts
@@ -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 = {
diff --git a/packages/env/src/ua-helper.ts b/packages/env/src/ua-helper.ts
index b7fabe9c7d..d15e1d80ba 100644
--- a/packages/env/src/ua-helper.ts
+++ b/packages/env/src/ua-helper.ts
@@ -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();