fix(mobile): replace router.push with router.navigate to prevent duplicate screens

This commit is contained in:
daniel31x13
2025-11-16 10:29:15 -05:00
parent 03ffc3c379
commit 9fc9e597e1
5 changed files with 10 additions and 10 deletions

View File

@@ -55,7 +55,7 @@ export default function HomeScreen() {
<Button
variant="accent"
size="lg"
onPress={() => router.push("/login")}
onPress={() => router.navigate("/login")}
>
<Text className="text-white text-xl">Get Started</Text>
</Button>

View File

@@ -31,7 +31,7 @@ const CollectionListing = ({ collection }: Props) => {
Platform.OS !== "android" && "active:bg-base-200/50"
)}
onLongPress={() => {}}
onPress={() => router.push(`/collections/${collection.id}`)}
onPress={() => router.navigate(`/collections/${collection.id}`)}
android_ripple={{
color: colorScheme === "dark" ? "rgba(255,255,255,0.2)" : "#ddd",
borderless: false,

View File

@@ -17,7 +17,7 @@ export default function DashboardItem({
return (
<TouchableOpacity
className="flex-1 flex-col gap-2 rounded-xl bg-base-200 p-3"
onPress={() => router.push(to as Href)}
onPress={() => router.navigate(to as Href)}
>
<View className="flex-row justify-between">
<View

View File

@@ -56,7 +56,7 @@ const LinkListing = ({ link, dashboard }: Props) => {
)}
onLongPress={() => {}}
onPress={() =>
router.push(
router.navigate(
data.preferredFormat
? `/links/${link.id}?format=${data.preferredFormat}`
: `/links/${link.id}`
@@ -145,7 +145,7 @@ const LinkListing = ({ link, dashboard }: Props) => {
<ContextMenu.Content avoidCollisions>
<ContextMenu.Item
key="open-link"
onSelect={() => router.push(`/links/${link.id}`)}
onSelect={() => router.navigate(`/links/${link.id}`)}
>
<ContextMenu.ItemTitle>Open Link</ContextMenu.ItemTitle>
</ContextMenu.Item>
@@ -201,7 +201,7 @@ const LinkListing = ({ link, dashboard }: Props) => {
<ContextMenu.Item
key="preserved-formats-webpage"
onSelect={() =>
router.push(
router.navigate(
`/links/${link.id}?format=${ArchivedFormat.monolith}`
)
}
@@ -213,7 +213,7 @@ const LinkListing = ({ link, dashboard }: Props) => {
<ContextMenu.Item
key="preserved-formats-screenshot"
onSelect={() =>
router.push(
router.navigate(
`/links/${link.id}?format=${
link.image?.endsWith(".png")
? ArchivedFormat.png
@@ -229,7 +229,7 @@ const LinkListing = ({ link, dashboard }: Props) => {
<ContextMenu.Item
key="preserved-formats-pdf"
onSelect={() =>
router.push(
router.navigate(
`/links/${link.id}?format=${ArchivedFormat.pdf}`
)
}
@@ -241,7 +241,7 @@ const LinkListing = ({ link, dashboard }: Props) => {
<ContextMenu.Item
key="preserved-formats-readable"
onSelect={() =>
router.push(
router.navigate(
`/links/${link.id}?format=${ArchivedFormat.readability}`
)
}

View File

@@ -31,7 +31,7 @@ const TagListing = ({ tag }: Props) => {
Platform.OS !== "android" && "active:bg-base-200/50"
)}
onLongPress={() => {}}
onPress={() => router.push(`/tags/${tag.id}`)}
onPress={() => router.navigate(`/tags/${tag.id}`)}
android_ripple={{
color: colorScheme === "dark" ? "rgba(255,255,255,0.2)" : "#ddd",
borderless: false,