From 2ec371bf0c1f91d00f01388f2dd94d7e001cb168 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 7 Feb 2019 14:00:34 +0100 Subject: [PATCH] MOBILE-2114 scorm: Fix offline data not detected on exit --- src/addon/mod/scorm/pages/player/player.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/addon/mod/scorm/pages/player/player.ts b/src/addon/mod/scorm/pages/player/player.ts index eafadea86..8fed9f121 100644 --- a/src/addon/mod/scorm/pages/player/player.ts +++ b/src/addon/mod/scorm/pages/player/player.ts @@ -442,7 +442,9 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy { this.tocObserver && this.tocObserver.off(); this.launchNextObserver && this.launchNextObserver.off(); this.launchPrevObserver && this.launchPrevObserver.off(); - this.goOfflineObserver && this.goOfflineObserver.off(); + setTimeout(() => { + this.goOfflineObserver && this.goOfflineObserver.off(); + }, 500); // Unblock the SCORM so it can be synced. this.syncProvider.unblockOperation(AddonModScormProvider.COMPONENT, this.scorm.id, 'player');