mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-21 16:41:24 +02:00
Fix back button not working
This commit is contained in:
@@ -39,7 +39,11 @@ export function UserProgressModal(props: ProgressMapProps) {
|
|||||||
userId: propUserId,
|
userId: propUserId,
|
||||||
onClose: onModalClose,
|
onClose: onModalClose,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const { s: userId = propUserId } = getUrlParams();
|
const { s: userId = propUserId } = getUrlParams();
|
||||||
|
if (!userId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const resourceSvgEl = useRef<HTMLDivElement>(null);
|
const resourceSvgEl = useRef<HTMLDivElement>(null);
|
||||||
const popupBodyEl = useRef<HTMLDivElement>(null);
|
const popupBodyEl = useRef<HTMLDivElement>(null);
|
||||||
@@ -97,7 +101,12 @@ export function UserProgressModal(props: ProgressMapProps) {
|
|||||||
deleteUrlParam('s');
|
deleteUrlParam('s');
|
||||||
setError('');
|
setError('');
|
||||||
setShowModal(false);
|
setShowModal(false);
|
||||||
onModalClose?.();
|
|
||||||
|
if (onModalClose) {
|
||||||
|
onModalClose();
|
||||||
|
} else {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useKeydown('Escape', () => {
|
useKeydown('Escape', () => {
|
||||||
@@ -177,7 +186,7 @@ export function UserProgressModal(props: ProgressMapProps) {
|
|||||||
const userLearning = progress?.learning?.length || 0;
|
const userLearning = progress?.learning?.length || 0;
|
||||||
const userSkipped = progress?.skipped?.length || 0;
|
const userSkipped = progress?.skipped?.length || 0;
|
||||||
|
|
||||||
if (!userId || currentUser?.id === userId) {
|
if (currentUser?.id === userId) {
|
||||||
deleteUrlParam('s');
|
deleteUrlParam('s');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user