Skip to content

Commit

Permalink
feat: Create delay before redirecting to previous page
Browse files Browse the repository at this point in the history
  • Loading branch information
iandebruin98 committed Nov 7, 2024
1 parent 5bd3d70 commit 6b2211c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/resource-detail/src/resource-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,16 @@ function ResourceDetail({
try {
if (typeof resource.delete === 'function') {
await resource.delete(resource.id);
window.history.back();
setTimeout(() => {
window.history.back();
}, 1000);
} else {
console.error('Delete method not found on resource');
}
} catch (e) {
console.error(e);
}
}
};

return (
<section>
Expand Down

0 comments on commit 6b2211c

Please sign in to comment.