From aaa714cb643b5ebfcbb9d3d1f60dbe6dff76cbd3 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 17 Jan 2024 11:36:45 +0100 Subject: [PATCH] MOBILE-3947 core: Fix wrong types for chooser plugin --- src/core/features/native/plugins/chooser.ts | 4 ++-- src/types/cordova-plugin-chooser.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/features/native/plugins/chooser.ts b/src/core/features/native/plugins/chooser.ts index 6e13746d7..b79931631 100644 --- a/src/core/features/native/plugins/chooser.ts +++ b/src/core/features/native/plugins/chooser.ts @@ -29,7 +29,7 @@ export class Chooser { * If error occurs, promise will be rejected. */ getFile(accept?: string): Promise { - return cordova.chooser.getFile(accept); + return window.chooser.getFile(accept); } /** @@ -41,7 +41,7 @@ export class Chooser { * If error occurs, promise will be rejected. */ getFileMetadata(accept?: string): Promise { - return cordova.chooser.getFileMetadata(accept); + return window.chooser.getFileMetadata(accept); } } diff --git a/src/types/cordova-plugin-chooser.d.ts b/src/types/cordova-plugin-chooser.d.ts index 6afe573cf..0473b7733 100644 --- a/src/types/cordova-plugin-chooser.d.ts +++ b/src/types/cordova-plugin-chooser.d.ts @@ -26,7 +26,7 @@ interface IChooserResult { uri: string; } -interface Cordova { +interface Window { chooser: { getFile(accept?: string): Promise;