Skip to content

Commit

Permalink
fix: after copy, go to new plan
Browse files Browse the repository at this point in the history
  • Loading branch information
Rei-x committed Sep 8, 2024
1 parent ef1e77c commit a4eb005
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/pages/shareplan/[hash].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@ const SharePlan = ({
numberOfPlans: plans.length,
});

void router.push(`/plans`).then(() => {
setPlans([...plans, newPlan]);
setPlanToCopy({
...planToCopy,
courses: plan.courses,
groups: plan.groups,
});
setPlans([...plans, newPlan]);
setPlanToCopy({
...planToCopy,
courses: plan.courses,
groups: plan.groups,
});

setTimeout(() => {
void router.push(`/createplan/${newPlan.id}`);
}, 200);
};
return (
<div className="flex max-h-screen flex-col overflow-x-hidden">
Expand Down

0 comments on commit a4eb005

Please sign in to comment.