Skip to content

Commit

Permalink
fix: App card routing
Browse files Browse the repository at this point in the history
  • Loading branch information
hetunandu committed Jan 22, 2025
1 parent 704e473 commit 0eff745
Showing 1 changed file with 30 additions and 18 deletions.
48 changes: 30 additions & 18 deletions app/client/src/pages/Applications/ApplicationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -477,26 +477,38 @@ export function ApplicationCard(props: ApplicationCardProps) {
return viewerURL({ basePageId, params: viewerParams });
}, [props.application.defaultBasePageId, viewerParams]);

const launchApp = useCallback(() => {
setURLParams();
dispatch(getCurrentUser());
}, []);
const launchApp = useCallback(
(e) => {
e.preventDefault();
e.stopPropagation();
setURLParams();
history.push(viewModeURL);
dispatch(getCurrentUser());
},
[dispatch, setURLParams, viewModeURL],
);

const editApp = useCallback(() => {
setURLParams();
dispatch(getCurrentUser());
}, []);
const editApp = useCallback(
(e) => {
e.preventDefault();
e.stopPropagation();
setURLParams();
history.push(editModeURL);
dispatch(getCurrentUser());
},
[dispatch, editModeURL, setURLParams],
);

const launchMobileApp = useCallback(() => {
setURLParams();
history.push(
viewerURL({
basePageId: props.application.defaultBasePageId,
params: viewerParams,
}),
);
dispatch(getCurrentUser());
}, [dispatch, props.application.defaultBasePageId, viewerParams]);
const launchMobileApp = useCallback(
(e) => {
e.preventDefault();
e.stopPropagation();
setURLParams();
history.push(viewModeURL);
dispatch(getCurrentUser());
},
[dispatch, props.application.defaultBasePageId, setURLParams, viewerParams],
);

return (
<Card
Expand Down

0 comments on commit 0eff745

Please sign in to comment.