Commit fb22f378 authored by motrebski's avatar motrebski Committed by Jonathan Porta
Browse files

Get SPS list in interval

parent 3dcb028f
......@@ -22,6 +22,8 @@ class SteemProposalSystem extends React.Component {
'voted',
];
interval = 2 * 60 * 1000;
orderedProposalKeys = [
'id',
'creator',
......@@ -61,6 +63,13 @@ class SteemProposalSystem extends React.Component {
}
}
componentDidMount() {
this.intervalId = setInterval(() => {
const { limit, status, last_id } = this.state;
this.getProposals(limit, status, last_id);
}, this.interval);
}
componentWillReceiveProps(nextProps) {
const { currentUser } = nextProps;
......@@ -69,6 +78,10 @@ class SteemProposalSystem extends React.Component {
}
}
componentWillUnmount() {
clearInterval(this.intervalId);
}
getSpsUrl(creator, permlink) {
const { social_url } = global.$STM_Config;
return `${social_url || ''}/@${creator}/${permlink}`;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment