WIP: Add Create Meeting button for registered users with no meetings

- OnboardMeetingListView now shows Create Meeting button for registered users when meetings.length === 0
- Added createMeeting() method to route to meeting setup page
- Maintains "No meetings available" message for unregistered users
- Resolves Test User #0 import flow where chair icon should show Create Meeting option
- Fixed linter errors in databaseUtil.ts and ImportAccountView.vue
This commit is contained in:
Matthew Raymer
2025-07-08 06:18:11 +00:00
parent 745830e150
commit 72c087e40a
8 changed files with 520 additions and 107 deletions

View File

@@ -66,7 +66,7 @@
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
<button
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md"
@click="fromMnemonic()"
@click="onImportClick()"
>
Import
</button>
@@ -89,7 +89,6 @@ import { Router } from "vue-router";
import { AppString, NotificationIface } from "../constants/app";
import { DEFAULT_ROOT_DERIVATION_PATH } from "../libs/crypto";
import { retrieveAccountCount, importFromMnemonic } from "../libs/util";
import { logger } from "../utils/logger";
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify";
@@ -184,39 +183,70 @@ export default class ImportAccountView extends Vue {
}
/**
* Imports identifier from mnemonic phrase
* Handles import button click
*
* Processes the mnemonic phrase with optional custom derivation path
* and account erasure options. Handles validation and error scenarios
* with appropriate user feedback.
*
* Error Handling:
* - Invalid mnemonic format validation
* - Import process failure recovery
* - User-friendly error messaging
* Validates input and initiates account import process
* Uses importFromMnemonic utility for secure import
*/
public async fromMnemonic() {
public async onImportClick() {
console.log("🔑 DEBUG: Import process started");
console.log("🔑 DEBUG: Mnemonic length:", this.mnemonic.split(" ").length);
console.log("🔑 DEBUG: Derivation path:", this.derivationPath);
console.log("🔑 DEBUG: Should erase:", this.shouldErase);
console.log("🔑 DEBUG: API Server:", this.apiServer);
if (!this.mnemonic?.trim()) {
this.notify.warning(
"Seed phrase is required to import an account.",
TIMEOUTS.LONG,
);
return;
}
try {
console.log("🔑 DEBUG: Calling importFromMnemonic...");
await importFromMnemonic(
this.mnemonic,
this.derivationPath,
this.shouldErase,
);
this.$router.push({ name: "account" });
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
logger.error("Error importing from mnemonic:", err);
if (err == "Error: invalid mnemonic") {
this.notify.error(
"Please check your mnemonic and try again.",
TIMEOUTS.LONG,
);
} else {
this.notify.error(
"Got an error creating that identifier.",
TIMEOUTS.LONG,
);
console.log("🔑 DEBUG: importFromMnemonic completed successfully");
// Check what was actually imported
const settings = await this.$accountSettings();
console.log("🔑 DEBUG: Post-import settings:", settings);
// Check account-specific settings
if (settings?.activeDid) {
try {
const accountSettings = await this.$query(
"SELECT * FROM settings WHERE accountDid = ?",
[settings.activeDid],
);
console.log(
"🔑 DEBUG: Post-import account-specific settings:",
accountSettings,
);
} catch (error) {
console.log("🔑 DEBUG: Error checking post-import settings:", error);
}
}
this.notify.success("Account imported successfully!", TIMEOUTS.STANDARD);
this.$router.push({ name: "account" });
} catch (error: any) {
console.log("🔑 DEBUG: Import failed with error:", error);
console.log("🔑 DEBUG: Error details:", {
message: error.message,
stack: error.stack,
name: error.name,
});
this.$logError("Import failed: " + error);
this.notify.error(
error.message || "Failed to import account.",
TIMEOUTS.LONG,
);
}
}
}