mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-24 17:28:41 +02:00
fix(link): Keybind, scroll behaviour, restrict drag to vertical (#176)
* chore: expose scrollActiveElementIntoView * feat(utils): editable element * fix: memoize exceptionRefs, use animation frame and check editable element * fix: improve btn on mobile * chore(drps): bump framer motion version * fix(link): big fix * chore: remove comment code * feat: touch device
This commit is contained in:
@@ -9,18 +9,20 @@ export const useLinkActions = () => {
|
||||
try {
|
||||
const index = me.root.personalLinks.findIndex(item => item?.id === link.id)
|
||||
if (index === -1) {
|
||||
console.error("Delete operation fail", { index, link })
|
||||
return
|
||||
throw new Error(`Link with id ${link.id} not found`)
|
||||
}
|
||||
|
||||
me.root.personalLinks.splice(index, 1)
|
||||
|
||||
toast.success("Link deleted.", {
|
||||
position: "bottom-right",
|
||||
description: `${link.title} has been deleted.`
|
||||
})
|
||||
|
||||
me.root.personalLinks.splice(index, 1)
|
||||
} catch (error) {
|
||||
toast.error("Failed to delete link")
|
||||
console.error("Failed to delete link:", error)
|
||||
toast.error("Failed to delete link", {
|
||||
description: error instanceof Error ? error.message : "An unknown error occurred"
|
||||
})
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user