Selaa lähdekoodia

fix: revert browser toast for high/low zoom (#5495)

Aakansha Doshi 2 vuotta sitten
vanhempi
commit
91fc22182c
2 muutettua tiedostoa jossa 2 lisäystä ja 21 poistoa
  1. 1 19
      src/components/App.tsx
  2. 1 2
      src/locales/en.json

+ 1 - 19
src/components/App.tsx

@@ -908,7 +908,6 @@ class App extends React.Component<AppProps, AppState> {
     } else {
       this.updateDOMRect(this.initializeScene);
     }
-    this.checkIfBrowserZoomed();
   }
 
   public componentWillUnmount() {
@@ -921,25 +920,8 @@ class App extends React.Component<AppProps, AppState> {
     clearTimeout(touchTimeout);
     touchTimeout = 0;
   }
-  private checkIfBrowserZoomed = () => {
-    if (!this.device.isMobile) {
-      const scrollBarWidth = 10;
-      const widthRatio =
-        (window.outerWidth - scrollBarWidth) / window.innerWidth;
-      const isBrowserZoomed = widthRatio < 0.75 || widthRatio > 1.1;
-      if (isBrowserZoomed) {
-        this.setToast({
-          message: t("alerts.browserZoom"),
-          closable: true,
-          duration: Infinity,
-        });
-      } else {
-        this.setToast(null);
-      }
-    }
-  };
+
   private onResize = withBatchedUpdates(() => {
-    this.checkIfBrowserZoomed();
     this.scene
       .getElementsIncludingDeleted()
       .forEach((element) => invalidateShapeForElement(element));

+ 1 - 2
src/locales/en.json

@@ -187,8 +187,7 @@
     "invalidSceneUrl": "Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.",
     "resetLibrary": "This will clear your library. Are you sure?",
     "removeItemsFromsLibrary": "Delete {{count}} item(s) from library?",
-    "invalidEncryptionKey": "Encryption key must be of 22 characters. Live collaboration is disabled.",
-    "browserZoom": "Your browser's zoom level is not set to 100% which may cause the board to display incorrectly"
+    "invalidEncryptionKey": "Encryption key must be of 22 characters. Live collaboration is disabled."
   },
   "errors": {
     "unsupportedFileType": "Unsupported file type.",