From 7c2a761078b28a158fbf6c7c1b8ca025b265928a Mon Sep 17 00:00:00 2001 From: Niklas Merz Date: Fri, 8 Dec 2017 20:58:53 +0100 Subject: [PATCH] refactor(three-dee-touch): use CordovaFunctionOverride decorator (#2028) --- .../plugins/three-dee-touch/index.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/@ionic-native/plugins/three-dee-touch/index.ts b/src/@ionic-native/plugins/three-dee-touch/index.ts index 20b94c1d9..6907118a0 100644 --- a/src/@ionic-native/plugins/three-dee-touch/index.ts +++ b/src/@ionic-native/plugins/three-dee-touch/index.ts @@ -1,10 +1,7 @@ import { Injectable } from '@angular/core'; -import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, CordovaFunctionOverride, Plugin, IonicNativePlugin } from '@ionic-native/core'; import { Observable } from 'rxjs/Observable'; - -declare var window: any; - export interface ThreeDeeTouchQuickAction { /** @@ -165,16 +162,8 @@ export class ThreeDeeTouch extends IonicNativePlugin { * When a home icon is pressed, your app launches and this JS callback is invoked. * @returns {Observable} returns an observable that notifies you when he user presses on the home screen icon */ - onHomeIconPressed(): Observable { - return new Observable(observer => { - if (window.ThreeDeeTouch) { - window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer); - } else { - observer.error('3dTouch plugin is not available.'); - observer.complete(); - } - }); - } + @CordovaFunctionOverride() + onHomeIconPressed(): Observable { return; } /** * Enable Link Preview.