Refactoring to prepare jpg imports

This commit is contained in:
Eric van der Vlist 2023-04-03 14:46:41 +02:00
parent 9863efc26a
commit f5e9657842
1 changed files with 5 additions and 5 deletions

View File

@ -61,14 +61,14 @@ const ImportSingleFile: Component<Props> = ({ file: file }) => {
const parseGpx = (content: string) => { const parseGpx = (content: string) => {
const gpx = GPX.parse(content); const gpx = GPX.parse(content);
console.log({ caller: 'GpxImportSingleFile / JSON', gpxFile: file, gpx }); console.log({ caller: 'ImportSingleFile / JSON', gpxFile: file, gpx });
setStatsAndGpx({ gpx, stats: analyzeGpx(gpx) }); setStatsAndGpx({ gpx, stats: analyzeGpx(gpx) });
}; };
if (typeof file === 'string') { if (typeof file === 'string') {
CapacitorFileSystem.requestPermissions().then((permissionStatus) => { CapacitorFileSystem.requestPermissions().then((permissionStatus) => {
console.log({ console.log({
caller: 'GpxImportSingleFile / content', caller: 'ImportSingleFile / content',
permissionStatus, permissionStatus,
}); });
}); });
@ -77,8 +77,8 @@ const ImportSingleFile: Component<Props> = ({ file: file }) => {
encoding: Encoding.UTF8, encoding: Encoding.UTF8,
}).then((content) => { }).then((content) => {
console.log({ console.log({
caller: 'GpxImportSingleFile / content', caller: 'ImportSingleFile / content',
gpxFile: file, file,
content, content,
}); });
parseGpx(content.data); parseGpx(content.data);
@ -91,7 +91,7 @@ const ImportSingleFile: Component<Props> = ({ file: file }) => {
async () => { async () => {
// this will then display a text gpxfile // this will then display a text gpxfile
console.log({ console.log({
caller: 'GpxImportSingleFile / XML', caller: 'ImportSingleFile / XML',
gpxFile: file, gpxFile: file,
result: gpxReader.result, result: gpxReader.result,
}); });