Skip to content

Commit

Permalink
Improve back button after opening a notification inside the app
Browse files Browse the repository at this point in the history
  • Loading branch information
fjsj committed Feb 8, 2025
1 parent 45ea572 commit 261089b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 8 additions & 2 deletions app/(app)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MedplumClient } from "@medplum/core";
import { useMedplumContext } from "@medplum/react-hooks";
import { Redirect, router, Slot } from "expo-router";
import { Redirect, router, Stack } from "expo-router";
import { useEffect } from "react";

import { LoadingScreen } from "@/components/LoadingScreen";
Expand Down Expand Up @@ -68,7 +68,13 @@ export default function AppLayout() {
return (
<ChatProvider>
{isPractitioner && <PractitionerBanner />}
<Slot />
<Stack
screenOptions={{
headerShown: false,
// Prevents flickering:
animation: "none",
}}
/>
</ChatProvider>
);
}
5 changes: 1 addition & 4 deletions components/ChatHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,8 @@ function BackButton({ isSelectionMode, onCancelSelection }: BackButtonProps) {
const handlePress = () => {
if (isSelectionMode) {
onCancelSelection?.();
} else if (router.canGoBack()) {
router.back();
} else {
router.replace("/");
}
router.dismissTo("/");
};

return (
Expand Down

0 comments on commit 261089b

Please sign in to comment.