fix preview close goes back instead of closing
This commit is contained in:
@@ -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() {
|
||||
|
Reference in New Issue
Block a user