From 77a865bb57f39251a28554853917516d8fb97232 Mon Sep 17 00:00:00 2001 From: Rohit Date: Tue, 7 Apr 2020 01:56:02 +0530 Subject: [PATCH 1/8] Fix for electron --- src/browser/FileProxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/FileProxy.js b/src/browser/FileProxy.js index 17955b686..3c571ddd6 100644 --- a/src/browser/FileProxy.js +++ b/src/browser/FileProxy.js @@ -29,7 +29,7 @@ // For chrome we don't need to implement proxy methods // All functionality can be accessed natively. - if (require('./isChrome')()) { + if (cordova.platformId === 'browser' && require('./isChrome')()) { var pathsPrefix = { // Read-only directory where the application is installed. applicationDirectory: location.origin + '/', // eslint-disable-line no-undef From 36b60c6f6cc377ba3ff11bac1c41a7ef836fb864 Mon Sep 17 00:00:00 2001 From: Rohit Date: Thu, 9 Apr 2020 01:57:52 +0530 Subject: [PATCH 2/8] Fix Directory reader input paramater bug --- www/DirectoryReader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/DirectoryReader.js b/www/DirectoryReader.js index 73669533c..cdfd28f55 100644 --- a/www/DirectoryReader.js +++ b/www/DirectoryReader.js @@ -56,7 +56,7 @@ DirectoryReader.prototype.readEntries = function (successCallback, errorCallback entry.isFile = result[i].isFile; entry.name = result[i].name; entry.fullPath = result[i].fullPath; - entry.filesystem = new (require('./FileSystem'))(result[i].filesystemName); + entry.filesystem = new (require('./FileSystem'))(result[i].filesystem.name); entry.nativeURL = result[i].nativeURL; retVal.push(entry); } From df5588505b1b9f3415f1a9663eeba28c68f21f77 Mon Sep 17 00:00:00 2001 From: Rohit Date: Thu, 9 Apr 2020 02:17:28 +0530 Subject: [PATCH 3/8] Update plugin.xml --- plugin.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.xml b/plugin.xml index 01bff31f6..f26afbceb 100644 --- a/plugin.xml +++ b/plugin.xml @@ -21,12 +21,12 @@ + version="6.0.3"> File Cordova File Plugin Apache 2.0 cordova,file - https://github.com/apache/cordova-plugin-file + https://github.com/jammer99/cordova-plugin-file https://github.com/apache/cordova-plugin-file/issues From 9dcef0b6a7fa833c995e326b2bafa7657ec00ee1 Mon Sep 17 00:00:00 2001 From: Rohit Date: Tue, 14 Apr 2020 16:06:12 +0530 Subject: [PATCH 4/8] fix error with filesystem --- package.json | 2 +- plugin.xml | 2 +- www/DirectoryReader.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 56df32f4a..9d6b314ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-file", - "version": "6.0.3-dev", + "version": "6.0.4", "description": "Cordova File Plugin", "types": "./types/index.d.ts", "cordova": { diff --git a/plugin.xml b/plugin.xml index f26afbceb..22c68c00a 100644 --- a/plugin.xml +++ b/plugin.xml @@ -21,7 +21,7 @@ + version="6.0.4"> File Cordova File Plugin Apache 2.0 diff --git a/www/DirectoryReader.js b/www/DirectoryReader.js index cdfd28f55..41aaa1629 100644 --- a/www/DirectoryReader.js +++ b/www/DirectoryReader.js @@ -56,7 +56,7 @@ DirectoryReader.prototype.readEntries = function (successCallback, errorCallback entry.isFile = result[i].isFile; entry.name = result[i].name; entry.fullPath = result[i].fullPath; - entry.filesystem = new (require('./FileSystem'))(result[i].filesystem.name); + entry.filesystem = new (require('./FileSystem'))(result[i].filesystem.name || result[i].filesystemName); entry.nativeURL = result[i].nativeURL; retVal.push(entry); } From 77b5d3925e4d62380cbe6d4c2b7b325c09437b01 Mon Sep 17 00:00:00 2001 From: Rohit Date: Tue, 14 Apr 2020 16:20:27 +0530 Subject: [PATCH 5/8] Update DirectoryReader.js --- www/DirectoryReader.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/DirectoryReader.js b/www/DirectoryReader.js index 41aaa1629..5144913f2 100644 --- a/www/DirectoryReader.js +++ b/www/DirectoryReader.js @@ -25,7 +25,7 @@ var FileError = require('./FileError'); /** * An interface that lists the files and directories in a directory. */ -function DirectoryReader (localURL) { +function DirectoryReader(localURL) { this.localURL = localURL || null; this.hasReadEntries = false; } @@ -46,6 +46,12 @@ DirectoryReader.prototype.readEntries = function (successCallback, errorCallback var win = typeof successCallback !== 'function' ? null : function (result) { var retVal = []; for (var i = 0; i < result.length; i++) { + var fs; + if (typeof result[i].filesystem !== undefined) + fs = result[i].filesystem.name; + else + fs = result[i].filesystemName; + var entry = null; if (result[i].isDirectory) { entry = new (require('./DirectoryEntry'))(); From 0df4299e1c9256fe5ea24d6af95f38f7ab4161b6 Mon Sep 17 00:00:00 2001 From: Rohit Date: Tue, 14 Apr 2020 16:32:30 +0530 Subject: [PATCH 6/8] Update DirectoryReader.js --- www/DirectoryReader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/DirectoryReader.js b/www/DirectoryReader.js index 5144913f2..8490689fb 100644 --- a/www/DirectoryReader.js +++ b/www/DirectoryReader.js @@ -47,7 +47,7 @@ DirectoryReader.prototype.readEntries = function (successCallback, errorCallback var retVal = []; for (var i = 0; i < result.length; i++) { var fs; - if (typeof result[i].filesystem !== undefined) + if (typeof result[i].filesystem !== "undefined") fs = result[i].filesystem.name; else fs = result[i].filesystemName; From 524dba2fd41d0f51c88495da99d591115e307521 Mon Sep 17 00:00:00 2001 From: Rohit Date: Tue, 14 Apr 2020 16:43:12 +0530 Subject: [PATCH 7/8] Update DirectoryReader.js --- www/DirectoryReader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/DirectoryReader.js b/www/DirectoryReader.js index 8490689fb..06716098f 100644 --- a/www/DirectoryReader.js +++ b/www/DirectoryReader.js @@ -62,7 +62,7 @@ DirectoryReader.prototype.readEntries = function (successCallback, errorCallback entry.isFile = result[i].isFile; entry.name = result[i].name; entry.fullPath = result[i].fullPath; - entry.filesystem = new (require('./FileSystem'))(result[i].filesystem.name || result[i].filesystemName); + entry.filesystem = new (require('./FileSystem'))(fs); entry.nativeURL = result[i].nativeURL; retVal.push(entry); } From 915f90012a4018ed219be42b6eebe1e57d3d725e Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 6 May 2020 13:52:14 +0530 Subject: [PATCH 8/8] fix tslint --- www/DirectoryReader.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/DirectoryReader.js b/www/DirectoryReader.js index 06716098f..5a86172f1 100644 --- a/www/DirectoryReader.js +++ b/www/DirectoryReader.js @@ -47,11 +47,11 @@ DirectoryReader.prototype.readEntries = function (successCallback, errorCallback var retVal = []; for (var i = 0; i < result.length; i++) { var fs; - if (typeof result[i].filesystem !== "undefined") + if (typeof result[i].filesystem !== 'undefined') { fs = result[i].filesystem.name; - else + } else { fs = result[i].filesystemName; - + } var entry = null; if (result[i].isDirectory) { entry = new (require('./DirectoryEntry'))();