From ccf7229f42bf051a458c99ddf51bc512e8aabafd Mon Sep 17 00:00:00 2001 From: Alena Date: Sat, 16 May 2020 21:47:19 +0200 Subject: [PATCH 1/2] Fix for App crashes when trying to open a file using modal with already installed app. --- www/plugins.FileOpener2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/plugins.FileOpener2.js b/www/plugins.FileOpener2.js index 693511b..5254c58 100644 --- a/www/plugins.FileOpener2.js +++ b/www/plugins.FileOpener2.js @@ -34,7 +34,7 @@ FileOpener2.prototype.open = function (fileName, contentType, callbackContext) { FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) { contentType = contentType || ''; - callbackContext = callbackContext || {}; + callbackContext = {...callbackContext, position: callbackContext.position ? callbackContext.position : [0, 0]}; exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false, callbackContext.position]); }; From 4ca507775852e48eddbdbd18012688a16c1c8dae Mon Sep 17 00:00:00 2001 From: Alena Date: Sat, 16 May 2020 22:46:50 +0200 Subject: [PATCH 2/2] default position is added --- www/plugins.FileOpener2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/plugins.FileOpener2.js b/www/plugins.FileOpener2.js index 5254c58..4049495 100644 --- a/www/plugins.FileOpener2.js +++ b/www/plugins.FileOpener2.js @@ -34,8 +34,8 @@ FileOpener2.prototype.open = function (fileName, contentType, callbackContext) { FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) { contentType = contentType || ''; - callbackContext = {...callbackContext, position: callbackContext.position ? callbackContext.position : [0, 0]}; - exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false, callbackContext.position]); + callbackContext = callbackContext || {}; + exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false, callbackContext.position || [0, 0]]); }; FileOpener2.prototype.uninstall = function (packageId, callbackContext) {