MOBILE-4059 core: Fix timeout types

main
Noel De Martin 2022-08-10 14:42:11 +02:00
parent 11fea266e9
commit 608ea978a0
2 changed files with 4 additions and 4 deletions

View File

@ -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);
}

View File

@ -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;