File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 11import { Directory , Encoding , Filesystem } from "@capacitor/filesystem" ;
22import ajax from "@deadlyjack/ajax" ;
3+ import { data } from "autoprefixer" ;
34import fsOperation from "fileSystem" ;
45import path from "path-browserify" ;
56import Url from "utils/Url" ;
@@ -125,15 +126,11 @@ const internalFs = {
125126 reject = setMessage ( reject ) ;
126127 Filesystem . readFile ( { path : filename , encoding : Encoding . UTF8 } )
127128 . then ( ( readFileResult ) => {
128- const fileReader = new FileReader ( ) ;
129- fileReader . onerror = reject ;
130- fileReader . readAsArrayBuffer ( readFileResult . data ) ;
131- fileReader . onloadend = ( ) => {
132- console . log (
133- `Successfully Read File contents for "${ filename } " file.` ,
134- ) ;
135- resolve ( { data : fileReader . result } ) ;
136- } ;
129+
130+ const encoder = new TextEncoder ( ) ;
131+ const buffer = encoder . encode ( readFileResult . data ) . buffer ;
132+
133+ resolve ( { data : buffer } )
137134 } )
138135 . catch ( ( error ) => {
139136 console . error (
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ class Logger {
100100 await fsOperation ( logFilePath ) . writeFile ( newData ) ;
101101 }
102102 } catch ( error ) {
103- console . error ( "Error in handling fs operation on log file. Error:" , err ) ;
103+ console . error ( "Error in handling fs operation on log file. Error:" , error ) ;
104104 }
105105 } ;
106106
You can’t perform that action at this time.
0 commit comments