Przeglądaj źródła

add if sentence if the client device is old ios version

kaori 5 lat temu
rodzic
commit
ec122fb1d6
1 zmienionych plików z 18 dodań i 10 usunięć
  1. 18 10
      src/client/js/services/AppContainer.js

+ 18 - 10
src/client/js/services/AppContainer.js

@@ -28,6 +28,7 @@ export default class AppContainer extends Container {
 
     this.state = {
       preferDarkModeByMediaQuery: false,
+      isOldIos: false,
 
       // stetes for contents
       recentlyUpdatedPages: [],
@@ -42,22 +43,28 @@ export default class AppContainer extends Container {
     const userAgent = window.navigator.userAgent.toLowerCase();
     this.isMobile = /iphone|ipad|android/.test(userAgent);
 
+    // ここから
     // this.isIos = /iphone|ipad/.test(userAgent);
+    // console.log(this.isIos);
+
     // const appVersion = window.navigator.appVersion.toLowerCase();
-    // if (isIos && appVersion < 12.5) {
-    //   return false;
-    // }
-    // const this.isOldIos =
-    // const isOldIos = false;
-    // if (userAgent.indexOf('iphone') !== -1 && appVersion.indexOf('12') !== -1) {
-    //   isOldIos = true;
-    //   console.log(appVersion);
-    // const iphone = userAagent.indexOf('iphone');
+
+    // console.log(`appVersion = ${appVersion}`);
     // this.isOldIos = /iphone 12/.test(appVersion);
-    // if (appVersion <= 12) {
 
+    // isOldVerion(version) {
+    //   if (version <= appVersion.indexOf('12.5')) {
+    //     return true;
+    //   }
     // }
 
+    // console.log(`isOldVerion = ${isOldVerion}`);
+
+    // if (this.isIos && isOldVerion) {
+    //   return true;
+    // }
+    // ここまで
+
 
     const currentUserElem = document.getElementById('growi-current-user');
     if (currentUserElem != null) {
@@ -128,6 +135,7 @@ export default class AppContainer extends Container {
     this.injectToWindow();
   }
 
+
   async initMediaQueryForColorScheme() {
     const switchStateByMediaQuery = async(mql) => {
       const preferDarkMode = mql.matches;