Skip to content

Commit

Permalink
fix(feed): fix feed live update
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Jun 18, 2018
1 parent ecac7f4 commit 8fa9ed3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/app/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
3 changes: 2 additions & 1 deletion translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"Activity": "Активность",
"downloading": "скачивается",
"Cancel download": "Отвенить закачку",
"Back to previus": "Вернуться на предыдущую"
"Back to previus": "Вернуться на предыдущую",
"Processing files": "Обработка файлов"
}
}
3 changes: 2 additions & 1 deletion translations/ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 8fa9ed3

Please sign in to comment.