Archived
sistemato popRelLoc.js
This commit is contained in:
@@ -18,11 +18,17 @@ class PopRelLoc extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
let tmp = JSON.parse(localStorage.getItem('lastWatched'));
|
axios.get("http://site1854.tw.cs.unibo.it/videotrack",{
|
||||||
let j = tmp.findIndex(el => el.id === localStorage["lastId"]);
|
params: {
|
||||||
//this.getThumbnailsNames(tmp[j].prevVideos);
|
"prevId" : localStorage['lastId']
|
||||||
if (tmp.length === 0 || localStorage["prevId"] === '1') { this.getThumbnailsNames(JSON.parse(localStorage.getItem('first'))) }
|
}
|
||||||
else { this.getThumbnailsNames(tmp[j].prevVideos) }
|
}).then(res=>{
|
||||||
|
this.getThumbnailsNames(res.data)
|
||||||
|
this.setState({
|
||||||
|
items : res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
error=>console.error(error))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user