fix preview close goes back instead of closing

This commit is contained in:
2025-05-21 13:21:35 +01:00
parent b0d458e5ca
commit cfcd510193

View File

@@ -201,8 +201,6 @@ function BookmarkPreviewTitleBar() {
function BookmarkPreviewActionBar() {
const { bookmarkId } = Route.useParams()
const navigate = useNavigate()
const router = useRouter()
const canGoBack = useCanGoBack()
const { data: bookmark, status } = useBookmark(bookmarkId)
const linkRef = useRef<HTMLAnchorElement | null>(null)
const [, _setActionBarHeight] = useAtom(setActionBarHeight)
@@ -216,11 +214,7 @@ function BookmarkPreviewActionBar() {
)
function close() {
if (canGoBack) {
router.history.back()
} else {
navigate({ to: "/bookmarks", replace: true })
}
navigate({ to: "/bookmarks", replace: true })
}
function openLink() {