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