mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-15 00:23:34 +03:00
added render require for force render when data changed
This commit is contained in:
parent
2a23a08108
commit
4e223281a5
@ -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