Skip to content

Commit

Permalink
fix: ChatGPTNextWeb#3016 disable sidebar transition on ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Yidadaa committed Nov 7, 2023
1 parent 1096fe5 commit 6e52d14
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions app/components/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useRef, useCallback } from "react";
import { useEffect, useRef, useCallback, useMemo } from "react";

import styles from "./home.module.scss";

Expand Down Expand Up @@ -26,7 +26,7 @@ import {
} from "../constant";

import { Link, useNavigate } from "react-router-dom";
import { useMobileScreen } from "../utils";
import { isIOS, useMobileScreen } from "../utils";
import dynamic from "next/dynamic";
import { showConfirm, showToast } from "./ui-lib";

Expand Down Expand Up @@ -134,6 +134,11 @@ export function SideBar(props: { className?: string }) {
const { onDragStart, shouldNarrow } = useDragSideBar();
const navigate = useNavigate();
const config = useAppConfig();
const isMobileScreen = useMobileScreen();
const isIOSMobile = useMemo(
() => isIOS() && isMobileScreen,
[isMobileScreen],
);

useHotKey();

Expand All @@ -142,6 +147,10 @@ export function SideBar(props: { className?: string }) {
className={`${styles.sidebar} ${props.className} ${
shouldNarrow && styles["narrow-sidebar"]
}`}
style={{
// #3016 disable transition on ios mobile screen
transition: isMobileScreen && isIOSMobile ? "none" : undefined,
}}
>
<div className={styles["sidebar-header"]} data-tauri-drag-region>
<div className={styles["sidebar-title"]} data-tauri-drag-region>
Expand Down

0 comments on commit 6e52d14

Please sign in to comment.