Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Julien Jerphanion
Rex Dri
Commits
f385513b
Commit
f385513b
authored
Aug 23, 2018
by
Florent Chehab
Browse files
slight tweaks
parent
3d718d3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/UnivMap.js
View file @
f385513b
...
...
@@ -10,7 +10,10 @@ import {
class
UnivMap
extends
Component
{
componentDidMount
()
{
this
.
props
.
fetchData
(
'
http://127.0.0.1:8000/api/university
'
);
if
(
this
.
props
.
universities
.
length
==
0
||
this
.
props
.
invalidated
){
console
.
log
(
"
here mother uc
"
,
this
.
props
.
universities
);
this
.
props
.
fetchData
(
'
http://127.0.0.1:8000/api/university
'
);
}
}
componentDidUpdate
(){
...
...
@@ -21,6 +24,14 @@ class UnivMap extends Component {
}
}
componentWillUnmount
()
{
console
.
log
(
"
ça serait bien de save la config de la carte...
"
);
}
render
()
{
if
(
this
.
props
.
hasError
)
{
return
<
p
>
Sorry
!
There
was
an
error
loading
the
items
<
/p>
;
...
...
frontend/src/components/UnivMapReloadButton.js
View file @
f385513b
...
...
@@ -21,7 +21,7 @@ class UnivMapReloadButton extends Component {
const
{
classes
}
=
this
.
props
;
return
(
<
IconButton
onClick
=
{()
=>
{
this
.
props
.
invalidate
()
}}
onClick
=
{()
=>
{
this
.
props
.
invalidate
(
true
)
}}
className
=
{
classes
.
floatRight
}
>
<
CachedIcon
/>
...
...
@@ -40,7 +40,7 @@ const mapStateToProps = (state) => {
const
mapDispatchToProps
=
(
dispatch
)
=>
{
return
{
invalidate
:
()
=>
dispatch
(
universitiesInvalidated
(
true
))
invalidate
:
(
bool
)
=>
dispatch
(
universitiesInvalidated
(
bool
))
};
};
...
...
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