fix(feed): fix feed live update

This commit is contained in:
Alexey Kasyanchuk 2018-06-18 16:14:22 +03:00
parent 5250b0f86c
commit bed8b5b51b
4 changed files with 15 additions and 3 deletions

View File

@ -17,6 +17,15 @@ export default class RecentTorrents extends Component {
this.forceUpdate();
}
}))
this.feedFunc = ({feed}) => {
this.torrents = feed
this.forceUpdate()
};
window.torrentSocket.on('feedUpdate', this.feedFunc);
}
componentWillUnmount() {
if(this.feedFunc)
window.torrentSocket.off('feedUpdate', this.feedFunc);
}
render() {
return (

View File

@ -163,6 +163,7 @@
"Activity": "Activity",
"downloading": "downloading",
"Cancel download": "Cancel download",
"Back to previus": "Back to previus"
"Back to previus": "Back to previus",
"Processing files": "Processing files"
}
}

View File

@ -163,6 +163,7 @@
"Activity": "Активность",
"downloading": "скачивается",
"Cancel download": "Отвенить закачку",
"Back to previus": "Вернуться на предыдущую"
"Back to previus": "Вернуться на предыдущую",
"Processing files": "Обработка файлов"
}
}

View File

@ -163,6 +163,7 @@
"Activity": "Activity",
"downloading": "downloading",
"Cancel download": "Cancel download",
"Back to previus": "Back to previus"
"Back to previus": "Back to previus",
"Processing files": "Processing files"
}
}