forked from trent_larson/crowd-funder-for-time-pwa
feat: migrate all clipboard operations from useClipboard to ClipboardService
- Replace useClipboard with platform-agnostic ClipboardService across 13 files - Add proper error handling with user notifications for all clipboard operations - Fix naming conflicts between method names and imported function names - Ensure consistent async/await patterns throughout the codebase - Add notification system to HelpView.vue for user feedback on clipboard errors - Remove unnecessary wrapper methods for cleaner code Files migrated: - View components: UserProfileView, QuickActionBvcEndView, ProjectViewView, InviteOneView, SeedBackupView, HelpView, AccountViewView, DatabaseMigration, ConfirmGiftView, ClaimView, OnboardMeetingSetupView - Utility functions: libs/util.ts (doCopyTwoSecRedo) - Components: HiddenDidDialog Naming conflicts resolved: - DatabaseMigration: copyToClipboard() → copyExportedDataToClipboard() - ShareMyContactInfoView: copyToClipboard() → copyContactMessageToClipboard() → removed - HiddenDidDialog: copyToClipboard() → copyTextToClipboard() - ClaimView: copyToClipboard() → copyTextToClipboard() - ConfirmGiftView: copyToClipboard() → copyTextToClipboard() This migration ensures reliable clipboard functionality across iOS, Android, and web platforms with proper error handling and user feedback. Closes: Platform-specific clipboard issues on mobile devices
This commit is contained in:
@@ -270,7 +270,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from "vue-facing-decorator";
|
||||
import { useClipboard } from "@vueuse/core";
|
||||
import { copyToClipboard } from "../services/ClipboardService";
|
||||
import { RouteLocationNormalizedLoaded, Router } from "vue-router";
|
||||
|
||||
import QuickNav from "../components/QuickNav.vue";
|
||||
@@ -676,12 +676,17 @@ export default class OnboardMeetingView extends Vue {
|
||||
this.notify.error(message, TIMEOUTS.LONG);
|
||||
}
|
||||
|
||||
copyMembersLinkToClipboard() {
|
||||
useClipboard()
|
||||
.copy(this.onboardMeetingMembersLink())
|
||||
.then(() => {
|
||||
this.notify.info(NOTIFY_MEETING_LINK_COPIED.message, TIMEOUTS.LONG);
|
||||
});
|
||||
async copyMembersLinkToClipboard() {
|
||||
try {
|
||||
await copyToClipboard(this.onboardMeetingMembersLink());
|
||||
this.notify.info(NOTIFY_MEETING_LINK_COPIED.message, TIMEOUTS.LONG);
|
||||
} catch (error) {
|
||||
this.$logAndConsole(
|
||||
`Error copying meeting link to clipboard: ${error}`,
|
||||
true,
|
||||
);
|
||||
this.notify.error("Failed to copy meeting link to clipboard.");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user