Fixed proxiwash screen not firing componentDidMount

This commit is contained in:
keplyx 2019-08-05 15:02:41 +02:00
parent 2b21b00ec8
commit cf8014da3f
2 changed files with 3 additions and 2 deletions

View file

@ -51,7 +51,7 @@ export default class FetchedDataSectionList extends React.Component<Props, State
} }
/** /**
* Refresh the FetchedData on first screen load * Register react navigation events on first screen load
*/ */
componentDidMount() { componentDidMount() {
this.willFocusSubscription = this.props.navigation.addListener( this.willFocusSubscription = this.props.navigation.addListener(

View file

@ -42,7 +42,7 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
* Creates machine state parameters using current theme and translations * Creates machine state parameters using current theme and translations
*/ */
constructor() { constructor() {
super(DATA_URL, 1000 * 60); // Refresh every minute super(DATA_URL, 1000 * 10); // Refresh every minute
let colors = ThemeManager.getCurrentThemeVariables(); let colors = ThemeManager.getCurrentThemeVariables();
stateColors[MACHINE_STATES.TERMINE] = colors.proxiwashFinishedColor; stateColors[MACHINE_STATES.TERMINE] = colors.proxiwashFinishedColor;
stateColors[MACHINE_STATES.DISPONIBLE] = colors.proxiwashReadyColor; stateColors[MACHINE_STATES.DISPONIBLE] = colors.proxiwashReadyColor;
@ -78,6 +78,7 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
} }
componentDidMount() { componentDidMount() {
super.componentDidMount();
if (Platform.OS === 'android') { if (Platform.OS === 'android') {
Expo.Notifications.createChannelAndroidAsync('reminders', { Expo.Notifications.createChannelAndroidAsync('reminders', {
name: 'Reminders', name: 'Reminders',