Browse Source

chore: linted with auto-fix

pull/130/head
Matthew Raymer 1 month ago
parent
commit
d83a25f47e
  1. 39
      src/components/DataExportSection.vue
  2. 12
      src/services/platforms/CapacitorPlatformService.ts
  3. 8
      src/services/platforms/ElectronPlatformService.ts
  4. 8
      src/services/platforms/PyWebViewPlatformService.ts
  5. 8
      src/services/platforms/WebPlatformService.ts

39
src/components/DataExportSection.vue

@ -1,16 +1,9 @@
/** /** * Data Export Section Component * * Provides UI and functionality for
* Data Export Section Component exporting user data and backing up identifier seeds. * Includes buttons for seed
* backup and database export, with platform-specific download instructions. * *
* Provides UI and functionality for exporting user data and backing up identifier seeds. @component * @displayName DataExportSection * @example * ```vue *
* Includes buttons for seed backup and database export, with platform-specific download instructions. <DataExportSection :active-did="currentDid" />
* * ``` */
* @component
* @displayName DataExportSection
* @example
* ```vue
* <DataExportSection :active-did="currentDid" />
* ```
*/
<template> <template>
<div <div
@ -42,17 +35,23 @@
> >
If no download happened yet, click again here to download now. If no download happened yet, click again here to download now.
</a> </a>
<div class="mt-4" v-if="platformCapabilities.needsFileHandlingInstructions"> <div v-if="platformCapabilities.needsFileHandlingInstructions" class="mt-4">
<p> <p>
After the download, you can save the file in your preferred storage After the download, you can save the file in your preferred storage
location. location.
</p> </p>
<ul> <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" On iOS: Choose "More..." and select a place in iCloud, or go "Back"
and save to another location. and save to another location.
</li> </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 On Android: Choose "Open" and then share
<font-awesome icon="share-nodes" class="fa-fw" /> <font-awesome icon="share-nodes" class="fa-fw" />
to your prefered place. to your prefered place.
@ -68,7 +67,10 @@ import { NotificationIface } from "../constants/app";
import { db } from "../db/index"; import { db } from "../db/index";
import { logger } from "../utils/logger"; import { logger } from "../utils/logger";
import { PlatformServiceFactory } from "../services/PlatformServiceFactory"; import { PlatformServiceFactory } from "../services/PlatformServiceFactory";
import { PlatformService, PlatformCapabilities } from "../services/PlatformService"; import {
PlatformService,
PlatformCapabilities,
} from "../services/PlatformService";
/** /**
* @vue-component * @vue-component
@ -100,7 +102,8 @@ export default class DataExportSection extends Vue {
/** /**
* Platform service instance for platform-specific operations * Platform service instance for platform-specific operations
*/ */
private platformService: PlatformService = PlatformServiceFactory.getInstance(); private platformService: PlatformService =
PlatformServiceFactory.getInstance();
/** /**
* Platform capabilities for the current platform * Platform capabilities for the current platform

12
src/services/platforms/CapacitorPlatformService.ts

@ -1,4 +1,8 @@
import { ImageResult, PlatformService, PlatformCapabilities } from "../PlatformService"; import {
ImageResult,
PlatformService,
PlatformCapabilities,
} from "../PlatformService";
import { Filesystem, Directory } from "@capacitor/filesystem"; import { Filesystem, Directory } from "@capacitor/filesystem";
import { Camera, CameraResultType, CameraSource } from "@capacitor/camera"; import { Camera, CameraResultType, CameraSource } from "@capacitor/camera";
import { logger } from "../../utils/logger"; import { logger } from "../../utils/logger";
@ -22,7 +26,7 @@ export class CapacitorPlatformService implements PlatformService {
isMobile: true, isMobile: true,
isIOS: /iPad|iPhone|iPod/.test(navigator.userAgent), isIOS: /iPad|iPhone|iPod/.test(navigator.userAgent),
hasFileDownload: false, hasFileDownload: false,
needsFileHandlingInstructions: true needsFileHandlingInstructions: true,
}; };
} }
@ -80,7 +84,9 @@ export class CapacitorPlatformService implements PlatformService {
path: directory, path: directory,
directory: Directory.Data, 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,
);
} }
/** /**

8
src/services/platforms/ElectronPlatformService.ts

@ -1,4 +1,8 @@
import { ImageResult, PlatformService, PlatformCapabilities } from "../PlatformService"; import {
ImageResult,
PlatformService,
PlatformCapabilities,
} from "../PlatformService";
import { logger } from "../../utils/logger"; import { logger } from "../../utils/logger";
/** /**
@ -25,7 +29,7 @@ export class ElectronPlatformService implements PlatformService {
isMobile: false, isMobile: false,
isIOS: false, isIOS: false,
hasFileDownload: false, // Not implemented yet hasFileDownload: false, // Not implemented yet
needsFileHandlingInstructions: false needsFileHandlingInstructions: false,
}; };
} }

8
src/services/platforms/PyWebViewPlatformService.ts

@ -1,4 +1,8 @@
import { ImageResult, PlatformService, PlatformCapabilities } from "../PlatformService"; import {
ImageResult,
PlatformService,
PlatformCapabilities,
} from "../PlatformService";
import { logger } from "../../utils/logger"; import { logger } from "../../utils/logger";
/** /**
@ -26,7 +30,7 @@ export class PyWebViewPlatformService implements PlatformService {
isMobile: false, isMobile: false,
isIOS: false, isIOS: false,
hasFileDownload: false, // Not implemented yet hasFileDownload: false, // Not implemented yet
needsFileHandlingInstructions: false needsFileHandlingInstructions: false,
}; };
} }

8
src/services/platforms/WebPlatformService.ts

@ -1,4 +1,8 @@
import { ImageResult, PlatformService, PlatformCapabilities } from "../PlatformService"; import {
ImageResult,
PlatformService,
PlatformCapabilities,
} from "../PlatformService";
import { logger } from "../../utils/logger"; import { logger } from "../../utils/logger";
/** /**
@ -26,7 +30,7 @@ export class WebPlatformService implements PlatformService {
isMobile: /iPhone|iPad|iPod|Android/i.test(navigator.userAgent), isMobile: /iPhone|iPad|iPod|Android/i.test(navigator.userAgent),
isIOS: /iPad|iPhone|iPod/.test(navigator.userAgent), isIOS: /iPad|iPhone|iPod/.test(navigator.userAgent),
hasFileDownload: true, hasFileDownload: true,
needsFileHandlingInstructions: false needsFileHandlingInstructions: false,
}; };
} }

Loading…
Cancel
Save