forked from jsnbuchanan/crowd-funder-for-time-pwa
chore: linted with auto-fix
This commit is contained in:
@@ -1,16 +1,9 @@
|
||||
/**
|
||||
* Data Export Section Component
|
||||
*
|
||||
* Provides UI and functionality for exporting user data and backing up identifier seeds.
|
||||
* Includes buttons for seed backup and database export, with platform-specific download instructions.
|
||||
*
|
||||
* @component
|
||||
* @displayName DataExportSection
|
||||
* @example
|
||||
* ```vue
|
||||
* <DataExportSection :active-did="currentDid" />
|
||||
* ```
|
||||
*/
|
||||
/** * Data Export Section Component * * Provides UI and functionality for
|
||||
exporting user data and backing up identifier seeds. * Includes buttons for seed
|
||||
backup and database export, with platform-specific download instructions. * *
|
||||
@component * @displayName DataExportSection * @example * ```vue *
|
||||
<DataExportSection :active-did="currentDid" />
|
||||
* ``` */
|
||||
|
||||
<template>
|
||||
<div
|
||||
@@ -42,17 +35,23 @@
|
||||
>
|
||||
If no download happened yet, click again here to download now.
|
||||
</a>
|
||||
<div class="mt-4" v-if="platformCapabilities.needsFileHandlingInstructions">
|
||||
<div v-if="platformCapabilities.needsFileHandlingInstructions" class="mt-4">
|
||||
<p>
|
||||
After the download, you can save the file in your preferred storage
|
||||
location.
|
||||
</p>
|
||||
<ul>
|
||||
<li v-if="platformCapabilities.isIOS" class="list-disc list-outside ml-4">
|
||||
<li
|
||||
v-if="platformCapabilities.isIOS"
|
||||
class="list-disc list-outside ml-4"
|
||||
>
|
||||
On iOS: Choose "More..." and select a place in iCloud, or go "Back"
|
||||
and save to another location.
|
||||
</li>
|
||||
<li v-if="platformCapabilities.isMobile && !platformCapabilities.isIOS" class="list-disc list-outside ml-4">
|
||||
<li
|
||||
v-if="platformCapabilities.isMobile && !platformCapabilities.isIOS"
|
||||
class="list-disc list-outside ml-4"
|
||||
>
|
||||
On Android: Choose "Open" and then share
|
||||
<font-awesome icon="share-nodes" class="fa-fw" />
|
||||
to your prefered place.
|
||||
@@ -68,7 +67,10 @@ import { NotificationIface } from "../constants/app";
|
||||
import { db } from "../db/index";
|
||||
import { logger } from "../utils/logger";
|
||||
import { PlatformServiceFactory } from "../services/PlatformServiceFactory";
|
||||
import { PlatformService, PlatformCapabilities } from "../services/PlatformService";
|
||||
import {
|
||||
PlatformService,
|
||||
PlatformCapabilities,
|
||||
} from "../services/PlatformService";
|
||||
|
||||
/**
|
||||
* @vue-component
|
||||
@@ -100,7 +102,8 @@ export default class DataExportSection extends Vue {
|
||||
/**
|
||||
* Platform service instance for platform-specific operations
|
||||
*/
|
||||
private platformService: PlatformService = PlatformServiceFactory.getInstance();
|
||||
private platformService: PlatformService =
|
||||
PlatformServiceFactory.getInstance();
|
||||
|
||||
/**
|
||||
* Platform capabilities for the current platform
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { ImageResult, PlatformService, PlatformCapabilities } from "../PlatformService";
|
||||
import {
|
||||
ImageResult,
|
||||
PlatformService,
|
||||
PlatformCapabilities,
|
||||
} from "../PlatformService";
|
||||
import { Filesystem, Directory } from "@capacitor/filesystem";
|
||||
import { Camera, CameraResultType, CameraSource } from "@capacitor/camera";
|
||||
import { logger } from "../../utils/logger";
|
||||
@@ -22,7 +26,7 @@ export class CapacitorPlatformService implements PlatformService {
|
||||
isMobile: true,
|
||||
isIOS: /iPad|iPhone|iPod/.test(navigator.userAgent),
|
||||
hasFileDownload: false,
|
||||
needsFileHandlingInstructions: true
|
||||
needsFileHandlingInstructions: true,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -80,7 +84,9 @@ export class CapacitorPlatformService implements PlatformService {
|
||||
path: directory,
|
||||
directory: Directory.Data,
|
||||
});
|
||||
return result.files.map(file => typeof file === 'string' ? file : file.name);
|
||||
return result.files.map((file) =>
|
||||
typeof file === "string" ? file : file.name,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { ImageResult, PlatformService, PlatformCapabilities } from "../PlatformService";
|
||||
import {
|
||||
ImageResult,
|
||||
PlatformService,
|
||||
PlatformCapabilities,
|
||||
} from "../PlatformService";
|
||||
import { logger } from "../../utils/logger";
|
||||
|
||||
/**
|
||||
@@ -25,7 +29,7 @@ export class ElectronPlatformService implements PlatformService {
|
||||
isMobile: false,
|
||||
isIOS: false,
|
||||
hasFileDownload: false, // Not implemented yet
|
||||
needsFileHandlingInstructions: false
|
||||
needsFileHandlingInstructions: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { ImageResult, PlatformService, PlatformCapabilities } from "../PlatformService";
|
||||
import {
|
||||
ImageResult,
|
||||
PlatformService,
|
||||
PlatformCapabilities,
|
||||
} from "../PlatformService";
|
||||
import { logger } from "../../utils/logger";
|
||||
|
||||
/**
|
||||
@@ -26,7 +30,7 @@ export class PyWebViewPlatformService implements PlatformService {
|
||||
isMobile: false,
|
||||
isIOS: false,
|
||||
hasFileDownload: false, // Not implemented yet
|
||||
needsFileHandlingInstructions: false
|
||||
needsFileHandlingInstructions: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { ImageResult, PlatformService, PlatformCapabilities } from "../PlatformService";
|
||||
import {
|
||||
ImageResult,
|
||||
PlatformService,
|
||||
PlatformCapabilities,
|
||||
} from "../PlatformService";
|
||||
import { logger } from "../../utils/logger";
|
||||
|
||||
/**
|
||||
@@ -26,7 +30,7 @@ export class WebPlatformService implements PlatformService {
|
||||
isMobile: /iPhone|iPad|iPod|Android/i.test(navigator.userAgent),
|
||||
isIOS: /iPad|iPhone|iPod/.test(navigator.userAgent),
|
||||
hasFileDownload: true,
|
||||
needsFileHandlingInstructions: false
|
||||
needsFileHandlingInstructions: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user