refactor(all): async/await

This commit is contained in:
Manu Mtz.-Almeida
2018-03-24 03:24:57 +01:00
parent ee1aaafd73
commit e20f76c3b1
10 changed files with 113 additions and 138 deletions

View File

@ -144,13 +144,12 @@ export class Picker implements OverlayInterface {
* Present the picker overlay after it has been created.
*/
@Method()
present(): Promise<void> {
return present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined).then(() => {
// If there is a duration, dismiss after that amount of time
if (this.duration > 10) {
this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
}
});
async present(): Promise<void> {
await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
if (this.duration > 0) {
this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
}
}
/**