mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-03 11:40:44 +03:00
Merge pull request #488 from esteemapp/bugfix/#439
added render require for force render when data changed
This commit is contained in:
commit
f60a57af03
@ -24,6 +24,7 @@ class VotersScreen extends PureComponent {
|
||||
this.state = {
|
||||
data: props.votes,
|
||||
filterResult: null,
|
||||
isRenderRequire: false,
|
||||
};
|
||||
}
|
||||
|
||||
@ -48,7 +49,7 @@ class VotersScreen extends PureComponent {
|
||||
break;
|
||||
}
|
||||
|
||||
this.setState({ filterResult: _data });
|
||||
this.setState({ filterResult: _data, isRenderRequire: true }, () => this.setState({ isRenderRequire: false }));
|
||||
};
|
||||
|
||||
_handleRightIconPress = () => {};
|
||||
@ -67,7 +68,7 @@ class VotersScreen extends PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { data, filterResult } = this.state;
|
||||
const { data, filterResult, isRenderRequire } = this.state;
|
||||
const { intl } = this.props;
|
||||
const headerTitle = intl.formatMessage({
|
||||
id: 'voters.voters_info',
|
||||
@ -86,7 +87,7 @@ class VotersScreen extends PureComponent {
|
||||
defaultText="REWARDS"
|
||||
onDropdownSelect={this._handleOnDropdownSelect}
|
||||
/>
|
||||
<VotersDisplay key={Math.random()} votes={filterResult || data} />
|
||||
{!isRenderRequire && <VotersDisplay key={Math.random()} votes={filterResult || data} />}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user