From 90f9980bca285a10d9de830e191681d7457324ba Mon Sep 17 00:00:00 2001
From: Dani Palou <dani@moodle.com>
Date: Thu, 9 May 2019 15:22:07 +0200
Subject: [PATCH] MOBILE-2915 desktop: Fix resume in desktop

---
 src/core/emulator/emulator.module.ts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/core/emulator/emulator.module.ts b/src/core/emulator/emulator.module.ts
index a74809625..fd903e89b 100644
--- a/src/core/emulator/emulator.module.ts
+++ b/src/core/emulator/emulator.module.ts
@@ -211,7 +211,8 @@ export const IONIC_NATIVE_PROVIDERS = [
     ]
 })
 export class CoreEmulatorModule {
-    constructor(appProvider: CoreAppProvider, initDelegate: CoreInitDelegate, helper: CoreEmulatorHelperProvider) {
+    constructor(appProvider: CoreAppProvider, initDelegate: CoreInitDelegate, helper: CoreEmulatorHelperProvider,
+            platform: Platform) {
         const win = <any> window; // Convert the "window" to "any" type to be able to use non-standard properties.
 
         // Emulate Custom URL Scheme plugin in desktop apps.
@@ -224,7 +225,7 @@ export class CoreEmulatorModule {
 
             // Listen for 'resume' events.
             require('electron').ipcRenderer.on('coreAppFocused', () => {
-                document.dispatchEvent(new Event('resume'));
+                platform.resume.emit();
             });
         }