Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
491bb542
Unverified
Commit
491bb542
authored
Dec 03, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Loader] fix another loading bug
parent
caa6d693
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
Loader.purs
src/Gargantext/Components/Loader.purs
+7
-2
No files found.
src/Gargantext/Components/Loader.purs
View file @
491bb542
...
@@ -55,10 +55,15 @@ createLoaderClass' name loader render =
...
@@ -55,10 +55,15 @@ createLoaderClass' name loader render =
, componentDidUpdate: \{path: prevPath} {currentPath} _snapshot -> do
, componentDidUpdate: \{path: prevPath} {currentPath} _snapshot -> do
{path} <- React.getProps this
{path} <- React.getProps this
logs $ name <> ".componentDidUpdate " <> show {currentPath, path, prevPath}
logs $ name <> ".componentDidUpdate " <> show {currentPath, path, prevPath}
-- This guard is the s
ame as
in performAction (SetPath ...),
-- This guard is the s
imilar to the one
in performAction (SetPath ...),
-- however we need it here to avoid potential infinite loops.
-- however we need it here to avoid potential infinite loops.
-- https://reactjs.org/docs/react-component.html#componentdidupdate
-- https://reactjs.org/docs/react-component.html#componentdidupdate
when (path /= currentPath) do
-- Moreover we want to make sure that not only the new prop
-- `path` is different from the one in the state (`currentPath`)
-- but also that it is different than the previous `path` prop
-- (`prevPath`). This avoid the path being reset to the
-- previous value.
when (prevPath /= path && path /= currentPath) do
dispatcher this (SetPath path)
dispatcher this (SetPath path)
})
})
where
where
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment