forked from jsnbuchanan/crowd-funder-for-time-pwa
Migrate HelpView.vue to PlatformServiceMixin - extract 7 inline handlers to methods
- Replace databaseUtil calls with PlatformServiceMixin for settings operations - Extract toggleAlpha/Group/Community/Verifiable/Governance/Basics methods - Add copyBitcoinAddress method with clipboard feedback - Enhance onboarding reset with error handling and logging - Human tested: all help sections, clipboard ops, platform navigation work - 6 minutes (3x faster than estimate), technically compliant
This commit is contained in:
@@ -23,17 +23,11 @@
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!givenName"
|
||||
:class="nameWarningClasses"
|
||||
>
|
||||
<div v-if="!givenName" :class="nameWarningClasses">
|
||||
<p class="mb-2">
|
||||
<b>Note:</b> your identity currently does <b>not</b> include a name.
|
||||
</p>
|
||||
<button
|
||||
:class="setNameButtonClasses"
|
||||
@click="openUserNameDialog"
|
||||
>
|
||||
<button :class="setNameButtonClasses" @click="openUserNameDialog">
|
||||
Set Your Name
|
||||
</button>
|
||||
</div>
|
||||
@@ -79,14 +73,9 @@
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-6">
|
||||
<div
|
||||
v-if="isScanning"
|
||||
:class="scannerContainerClasses"
|
||||
>
|
||||
<div v-if="isScanning" :class="scannerContainerClasses">
|
||||
<!-- Status Message -->
|
||||
<div
|
||||
:class="statusMessageClasses"
|
||||
>
|
||||
<div :class="statusMessageClasses">
|
||||
<div
|
||||
v-if="cameraState === 'initializing'"
|
||||
class="flex items-center justify-center space-x-2"
|
||||
@@ -125,9 +114,7 @@
|
||||
</p>
|
||||
<p v-else-if="error" class="text-red-400">Error: {{ error }}</p>
|
||||
<p v-else class="flex items-center justify-center space-x-2">
|
||||
<span
|
||||
:class="cameraStatusIndicatorClasses"
|
||||
></span>
|
||||
<span :class="cameraStatusIndicatorClasses"></span>
|
||||
<span>{{ cameraStateMessage || "Ready to scan" }}</span>
|
||||
</p>
|
||||
</div>
|
||||
@@ -290,14 +277,14 @@ export default class ContactQRScanShow extends Vue {
|
||||
|
||||
get cameraStatusIndicatorClasses(): Record<string, boolean> {
|
||||
return {
|
||||
'inline-block w-2 h-2 rounded-full': true,
|
||||
'bg-green-500': this.cameraState === 'ready',
|
||||
'bg-yellow-500': this.cameraState === 'in_use',
|
||||
'bg-red-500':
|
||||
this.cameraState === 'error' ||
|
||||
this.cameraState === 'permission_denied' ||
|
||||
this.cameraState === 'not_found',
|
||||
'bg-blue-500': this.cameraState === 'off',
|
||||
"inline-block w-2 h-2 rounded-full": true,
|
||||
"bg-green-500": this.cameraState === "ready",
|
||||
"bg-yellow-500": this.cameraState === "in_use",
|
||||
"bg-red-500":
|
||||
this.cameraState === "error" ||
|
||||
this.cameraState === "permission_denied" ||
|
||||
this.cameraState === "not_found",
|
||||
"bg-blue-500": this.cameraState === "off",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -365,12 +352,18 @@ export default class ContactQRScanShow extends Vue {
|
||||
case "in_use":
|
||||
this.error = "Camera is in use by another application";
|
||||
this.isScanning = false;
|
||||
this.notify.warning(NOTIFY_QR_CAMERA_IN_USE.message, QR_TIMEOUT_LONG);
|
||||
this.notify.warning(
|
||||
NOTIFY_QR_CAMERA_IN_USE.message,
|
||||
QR_TIMEOUT_LONG,
|
||||
);
|
||||
break;
|
||||
case "permission_denied":
|
||||
this.error = "Camera permission denied";
|
||||
this.isScanning = false;
|
||||
this.notify.warning(NOTIFY_QR_CAMERA_ACCESS_REQUIRED.message, QR_TIMEOUT_LONG);
|
||||
this.notify.warning(
|
||||
NOTIFY_QR_CAMERA_ACCESS_REQUIRED.message,
|
||||
QR_TIMEOUT_LONG,
|
||||
);
|
||||
break;
|
||||
case "not_found":
|
||||
this.error = "No camera found";
|
||||
@@ -529,7 +522,7 @@ export default class ContactQRScanShow extends Vue {
|
||||
this.notify.error(
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: NOTIFY_QR_PROCESSING_ERROR.message
|
||||
: NOTIFY_QR_PROCESSING_ERROR.message,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -554,7 +547,10 @@ export default class ContactQRScanShow extends Vue {
|
||||
did: contact.did,
|
||||
name: contact.name,
|
||||
});
|
||||
this.notify.toast(NOTIFY_QR_REGISTRATION_SUBMITTED.message, QR_TIMEOUT_SHORT);
|
||||
this.notify.toast(
|
||||
NOTIFY_QR_REGISTRATION_SUBMITTED.message,
|
||||
QR_TIMEOUT_SHORT,
|
||||
);
|
||||
|
||||
try {
|
||||
const regResult = await register(
|
||||
@@ -719,7 +715,10 @@ export default class ContactQRScanShow extends Vue {
|
||||
contact.seesMe = true;
|
||||
}
|
||||
|
||||
this.notify.success(createQRContactAddedMessage(!!this.activeDid), QR_TIMEOUT_STANDARD);
|
||||
this.notify.success(
|
||||
createQRContactAddedMessage(!!this.activeDid),
|
||||
QR_TIMEOUT_STANDARD,
|
||||
);
|
||||
|
||||
if (
|
||||
this.isRegistered &&
|
||||
|
||||
Reference in New Issue
Block a user