Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

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

daniel31x139fc9e597e12f
diff --git a/apps/mobile/app/index.tsx b/apps/mobile/app/index.tsx
index ad647643..88324985 100644
--- a/apps/mobile/app/index.tsx
+++ b/apps/mobile/app/index.tsx
@@ -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>
diff --git a/apps/mobile/components/CollectionListing.tsx b/apps/mobile/components/CollectionListing.tsx
index d38d8ff1..0aa6fb64 100644
--- a/apps/mobile/components/CollectionListing.tsx
+++ b/apps/mobile/components/CollectionListing.tsx
@@ -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,
diff --git a/apps/mobile/components/DashboardItem.tsx b/apps/mobile/components/DashboardItem.tsx
index 2ba472e0..e33986f7 100644
--- a/apps/mobile/components/DashboardItem.tsx
+++ b/apps/mobile/components/DashboardItem.tsx
@@ -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
diff --git a/apps/mobile/components/LinkListing.tsx b/apps/mobile/components/LinkListing.tsx
index a073dd6e..29558121 100644
--- a/apps/mobile/components/LinkListing.tsx
+++ b/apps/mobile/components/LinkListing.tsx
@@ -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}`
)
}
diff --git a/apps/mobile/components/TagListing.tsx b/apps/mobile/components/TagListing.tsx
index e7f6e9b8..40267e55 100644
--- a/apps/mobile/components/TagListing.tsx
+++ b/apps/mobile/components/TagListing.tsx
@@ -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,