From c3c8594199a5b7df754e8dac47e181736296bbed Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 21 Apr 2022 12:26:11 +0200 Subject: [PATCH] MOBILE-3833 user-tours: Fix close user tours in iOS 12 --- src/core/features/course/pages/contents/contents.ts | 1 - .../usertours/components/user-tour/user-tour.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/features/course/pages/contents/contents.ts b/src/core/features/course/pages/contents/contents.ts index 62915db57..5ac35bca3 100644 --- a/src/core/features/course/pages/contents/contents.ts +++ b/src/core/features/course/pages/contents/contents.ts @@ -353,7 +353,6 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy, CoreRefreshCon * @return Promise resolved when done. */ protected async showLoadingAndRefresh(sync = false, invalidateData = true): Promise { - // Save scroll position to restore it once done. this.updatingData = true; this.changeDetectorRef.detectChanges(); diff --git a/src/core/features/usertours/components/user-tour/user-tour.ts b/src/core/features/usertours/components/user-tour/user-tour.ts index 28d6bba73..cab608b62 100644 --- a/src/core/features/usertours/components/user-tour/user-tour.ts +++ b/src/core/features/usertours/components/user-tour/user-tour.ts @@ -183,6 +183,11 @@ export class CoreUserToursUserTourComponent implements AfterViewInit, OnDestroy * Play animation to show that the User Tour has started. */ private async playEnterAnimation(): Promise { + if (!('animate' in this.element)) { + // Not supported, don't animate. + return; + } + const animations = [ this.element.animate({ opacity: ['0', '1'] }, { duration: ANIMATION_DURATION }), this.wrapperElement.value?.animate( @@ -198,6 +203,11 @@ export class CoreUserToursUserTourComponent implements AfterViewInit, OnDestroy * Play animation to show that the User Tour has endd. */ private async playLeaveAnimation(): Promise { + if (!('animate' in this.element)) { + // Not supported, don't animate. + return; + } + const animations = [ this.element.animate({ opacity: ['1', '0'] }, { duration: ANIMATION_DURATION }), this.wrapperElement.value?.animate(