-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go back from settings to location / edit location / review / map (#545)
* Go back from settings to location / edit location / review / map * Only 'back from settings' for location if opened through map Opening location page through back button shouldn't count because then we have an infinite loop
- Loading branch information
Showing
7 changed files
with
86 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useEffect } from 'react' | ||
import { useDispatch, useSelector } from 'react-redux' | ||
|
||
import { clearReview } from '../../redux/reviewSlice' | ||
|
||
const DisconnectReview = () => { | ||
const dispatch = useDispatch() | ||
const { review } = useSelector((state) => state.review) | ||
|
||
useEffect(() => { | ||
if (review) { | ||
dispatch(clearReview()) | ||
} | ||
}, [dispatch, review?.id]) //eslint-disable-line | ||
|
||
return null | ||
} | ||
|
||
export default DisconnectReview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters