Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
ViaResto-website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aymeric Chaumont
ViaResto-website
Merge requests
!42
handle go back events
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
handle go back events
handle_go_back_events
into
main
Overview
0
Commits
2
Pipelines
4
Changes
1
Merged
handle go back events
Antoine Gaudron-Desjardins
requested to merge
handle_go_back_events
into
main
Jul 19, 2022
Overview
0
Commits
2
Pipelines
4
Changes
1
0
0
Merge request reports
Compare
main
version 1
f0f0fba8
Jul 19, 2022
main (base)
and
latest version
latest version
5a028bdc
2 commits,
Jul 19, 2022
version 1
f0f0fba8
1 commit,
Jul 19, 2022
1 file
+
6
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
frontend/src/index.js
+
6
−
0
View file @ 5a028bdc
Edit in single-file editor
Open in Web IDE
Show full file
@@ -41,6 +41,8 @@ export default function App() {
},
[
reload
]);
useEffect
(()
=>
{
window
.
addEventListener
(
"
popstate
"
,
()
=>
setReload
(
true
));
let
path
=
window
.
location
.
pathname
.
split
(
"
/
"
);
if
(
restaurantsList
&&
path
.
length
>=
2
&&
path
[
1
])
{
let
name
=
decodeURIComponent
(
path
[
1
]);
@@ -48,7 +50,11 @@ export default function App() {
if
(
filter
)
{
setSelection
(
filter
[
0
]);
}
}
else
{
setSelection
(
null
);
}
return
()
=>
window
.
removeEventListener
(
"
popstate
"
,
()
=>
setReload
(
true
));
},
[
restaurantsList
]);
useEffect
(()
=>
{
Loading