Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,11 @@ class TimePickerAndroid {
/**
* A time has been selected.
*/
static getTimeSetAction(): string {
return 'timeSetAction';
}
static timeSetAction = 'timeSetAction';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. You forgot to make this covariant:

static +timeSetAction: string = 'timeSetAction';

/**
* The dialog has been dismissed.
*/
static getDismissedAction(): string {
return 'dismissedAction';
}
static dismissedAction = 'dismissedAction';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you forgot to make this covariant:

static +dismissedAction: string = 'dismissedAction';

You need the + after the static and before dismissedAction.

}

module.exports = TimePickerAndroid;
4 changes: 2 additions & 2 deletions RNTester/js/TimePickerAndroidExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ class TimePickerAndroidExample extends React.Component {
try {
const {action, minute, hour} = await TimePickerAndroid.open(options);
const newState = {};
if (action === TimePickerAndroid.getTimeSetAction) {
if (action === TimePickerAndroid.timeSetAction) {
newState[stateKey + 'Text'] = _formatTime(hour, minute);
newState[stateKey + 'Hour'] = hour;
newState[stateKey + 'Minute'] = minute;
} else if (action === TimePickerAndroid.getDismissedAction) {
} else if (action === TimePickerAndroid.dismissedAction) {
newState[stateKey + 'Text'] = 'dismissed';
}
this.setState(newState);
Expand Down
4 changes: 2 additions & 2 deletions ReactAndroid/src/androidTest/js/TimePickerDialogTestModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ var TimePickerDialogTestModule = {
showTimePickerDialog: function(options) {
TimePickerAndroid.open(options).then(
({action, hour, minute}) => {
if (action === TimePickerAndroid.getTimeSetAction) {
if (action === TimePickerAndroid.timeSetAction) {
RecordingModule.recordTime(hour, minute);
} else if (action === TimePickerAndroid.getDismissedAction) {
} else if (action === TimePickerAndroid.dismissedAction) {
RecordingModule.recordDismissed();
}
},
Expand Down