Skip to content

Commit

Permalink
#181: calculate after loading the file initialy
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianHanfland committed Dec 7, 2024
1 parent 7de45f8 commit aa99932
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
17 changes: 0 additions & 17 deletions website/src/planner/map/hooks/parseCalculatedTracksHook.ts

This file was deleted.

5 changes: 4 additions & 1 deletion website/src/planner/useLoadPlanningFromServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import { useEffect } from 'react';
import { getData } from '../api/api.ts';
import { backendActions, getPlanningPassword } from './store/backend.reducer.ts';
import { errorNotification, successNotification, toastsActions } from './store/toast.reducer.ts';
import { calculateTracks } from './logic/automaticCalculation.ts';
import { AppDispatch } from './store/store.ts';

export function useLoadPlanningFromServer() {
const planningId = useGetUrlParam('planning=');
const adminToken = useGetUrlParam('admin=');
const planningPassword = useSelector(getPlanningPassword);
const dispatch = useDispatch();
const dispatch: AppDispatch = useDispatch();
const intl = useIntl();

useEffect(() => {
Expand All @@ -30,6 +32,7 @@ export function useLoadPlanningFromServer() {
intl.formatMessage({ id: 'msg.dataLoad.success.title' }),
intl.formatMessage({ id: 'msg.dataLoad.success.message' })
);
dispatch(calculateTracks);
})
.catch(() => {
errorNotification(
Expand Down

0 comments on commit aa99932

Please sign in to comment.