diff --git a/src/components/DataExportSection.vue b/src/components/DataExportSection.vue index b34b3430..cfbc2dea 100644 --- a/src/components/DataExportSection.vue +++ b/src/components/DataExportSection.vue @@ -100,6 +100,13 @@ export default class DataExportSection extends Vue { */ notify = createNotifyHelpers(this.$notify); + /** + * NOTE: PlatformServiceMixin provides both concise helpers (e.g. $contacts, capabilities) + * and the full platformService instance for advanced/native features (e.g. writeAndShareFile). + * Always use 'this.platformService' as a property (never as a function). + */ + declare readonly platformService: import("@/services/PlatformService").PlatformService; + /** * Computed property to check if we're on web platform */ diff --git a/src/utils/PlatformServiceMixin.ts b/src/utils/PlatformServiceMixin.ts index ae070650..44ff2204 100644 --- a/src/utils/PlatformServiceMixin.ts +++ b/src/utils/PlatformServiceMixin.ts @@ -121,30 +121,26 @@ export const PlatformServiceMixin = { * Platform detection utilities */ isCapacitor(): boolean { - return (this as unknown as VueComponentWithMixin) - .platformService() - .isCapacitor(); + // @ts-expect-error Accessing computed property value from Vue instance + return this["platformService"].isCapacitor(); }, isWeb(): boolean { - return (this as unknown as VueComponentWithMixin) - .platformService() - .isWeb(); + // @ts-expect-error Accessing computed property value from Vue instance + return this["platformService"].isWeb(); }, isElectron(): boolean { - return (this as unknown as VueComponentWithMixin) - .platformService() - .isElectron(); + // @ts-expect-error Accessing computed property value from Vue instance + return this["platformService"].isElectron(); }, /** * Platform capabilities */ capabilities() { - return (this as unknown as VueComponentWithMixin) - .platformService() - .getCapabilities(); + // @ts-expect-error Accessing computed property value from Vue instance + return this["platformService"].getCapabilities(); }, },