I was creating a project selection box and encountered a problem: when I select a project, it works fine and reloads the project, displaying the new data on the screen normally. However, when I select a project with a baseline, the backend returns the data correctly, but the frontend gets stuck in an infinite loading loop, and the browser CPU usage spikes to 100% until I reload the page.
That is the code that reloads the project:
function selectProject(projectId: string) {
schedule?.setNewProjectIds(companyId, [projectId]);
router.push({ name: "schedule", params: { projectId }, replace: true });
reloadSchedule();
}
async function reloadSchedule() {
if (!schedule) return;
await schedule.load();
}