MOBILE-4059 core: Fix timeout types
parent
11fea266e9
commit
608ea978a0
|
@ -31,7 +31,7 @@ export class AddonModH5PActivityIndexPage extends CoreCourseModuleMainActivityPa
|
|||
implements CanLeave, OnDestroy {
|
||||
|
||||
canLeaveSafely = false;
|
||||
remainingTimeout?: ReturnType<typeof setTimeout>;
|
||||
remainingTimeout?: number;
|
||||
|
||||
@ViewChild(AddonModH5PActivityIndexComponent) activityComponent?: AddonModH5PActivityIndexComponent;
|
||||
|
||||
|
@ -68,7 +68,7 @@ export class AddonModH5PActivityIndexPage extends CoreCourseModuleMainActivityPa
|
|||
clearTimeout(this.remainingTimeout);
|
||||
}
|
||||
// When user finish an activity, he have 10 seconds to leave safely (without show alert).
|
||||
this.remainingTimeout = setTimeout(() => {
|
||||
this.remainingTimeout = window.setTimeout(() => {
|
||||
this.canLeaveSafely = false;
|
||||
}, 10000);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ export class CoreLongPressDirective implements OnInit, OnDestroy {
|
|||
|
||||
element: HTMLElement;
|
||||
pressGesture?: Gesture;
|
||||
timeout?: NodeJS.Timeout;
|
||||
timeout?: number;
|
||||
|
||||
@Output() longPress = new EventEmitter();
|
||||
|
||||
|
@ -48,7 +48,7 @@ export class CoreLongPressDirective implements OnInit, OnDestroy {
|
|||
disableScroll: true,
|
||||
gestureName: 'longpress',
|
||||
onStart: (event) => {
|
||||
this.timeout = setTimeout(() => {
|
||||
this.timeout = window.setTimeout(() => {
|
||||
this.longPress.emit(event);
|
||||
|
||||
delete this.timeout;
|
||||
|
|
Loading…
Reference in New Issue