Merge branch 'layout1' of https://bitbucket.org/sco44/tecnologiabanana into layout1

This commit is contained in:
matteo
2019-03-03 21:59:18 +01:00
+11 -5
View File
@@ -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))
} }