Skip to content

Commit

Permalink
Make the fullscreen restore hack work on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Nov 23, 2023
1 parent 45ff5e1 commit 815ba44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib/telegram/prevent-telegram-swipe-down-closing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ export const PreventTelegramSwipeDownClosingIos = (props: {
};

// A hacky way to force expand app back whenever user pull app down
export const usePreventTelegramSwipeDownAndroid = () => {
export const useRestoreFullScreenExpand = () => {
useEffect(() => {
if (WebApp.platform !== "android") {
if (WebApp.platform !== "android" && WebApp.platform !== 'ios') {
return;
}
const onViewPortChanged = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/screens/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import { deckListStore } from "../store/deck-list-store.ts";
import { FullScreenLoader } from "./deck-list/full-screen-loader.tsx";
import {
PreventTelegramSwipeDownClosingIos,
usePreventTelegramSwipeDownAndroid
useRestoreFullScreenExpand
} from "../lib/telegram/prevent-telegram-swipe-down-closing.tsx";

export const App = observer(() => {
usePreventTelegramSwipeDownAndroid();
useRestoreFullScreenExpand();

if (deckListStore.isSharedDeckLoading || deckListStore.isDeckRemoving) {
return <FullScreenLoader />;
Expand Down

0 comments on commit 815ba44

Please sign in to comment.