diff --git a/components/WebSectionList.js b/components/WebSectionList.js index 481a9e1..3e2c58d 100644 --- a/components/WebSectionList.js +++ b/components/WebSectionList.js @@ -16,6 +16,7 @@ type Props = { renderSectionHeader: React.Node, stickyHeader: boolean, createDataset: Function, + updateData: number, } type State = { @@ -28,19 +29,15 @@ type State = { const MIN_REFRESH_TIME = 5 * 1000; /** - * Custom component defining a material icon using native base - * - * @prop active {boolean} Whether to set the icon color to active - * @prop icon {string} The icon string to use from MaterialCommunityIcons - * @prop color {string} The icon color. Use default theme color if unspecified - * @prop fontSize {number} The icon size. Use 26 if unspecified - * @prop width {number} The icon width. Use 30 if unspecified + * This is a pure component, meaning it will only update if a shallow comparison of state and props is different. + * To force the component to update, change the value of updateData. */ export default class WebSectionList extends React.PureComponent { static defaultProps = { renderSectionHeader: null, stickyHeader: false, + updateData: null, }; webDataManager: WebDataManager; @@ -88,8 +85,6 @@ export default class WebSectionList extends React.PureComponent { this.onRefresh(); } - - /** * Refresh data when focusing the screen and setup a refresh interval if asked to */ diff --git a/screens/Proxiwash/ProxiwashScreen.js b/screens/Proxiwash/ProxiwashScreen.js index 6eef91a..16430d7 100644 --- a/screens/Proxiwash/ProxiwashScreen.js +++ b/screens/Proxiwash/ProxiwashScreen.js @@ -464,7 +464,8 @@ class ProxiwashScreen extends React.Component { renderItem={this.getRenderItem} renderSectionHeader={this.getRenderSectionHeader} autoRefreshTime={REFRESH_TIME} - refreshOnFocus={true}/> + refreshOnFocus={true} + updateData={this.state.machinesWatched.length}/> );