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