mirror of
https://github.com/linkwarden/linkwarden.git
synced 2026-03-03 03:47:02 +00:00
fix(mobile): replace router.push with router.navigate to prevent duplicate screens
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}`
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user