diff --git a/src/components/layout/ProfileSheetContent.vue b/src/components/layout/ProfileSheetContent.vue index 26667b1..76635c9 100644 --- a/src/components/layout/ProfileSheetContent.vue +++ b/src/components/layout/ProfileSheetContent.vue @@ -1,38 +1,122 @@ diff --git a/src/modules/base/components/ProfileSettings.vue b/src/modules/base/components/ProfileSettings.vue index 1ad99ef..7a3386a 100644 --- a/src/modules/base/components/ProfileSettings.vue +++ b/src/modules/base/components/ProfileSettings.vue @@ -1,14 +1,5 @@ @@ -173,8 +121,7 @@ import { toTypedSchema } from '@vee-validate/zod' import * as z from 'zod' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' -import { Separator } from '@/components/ui/separator' -import { User, Zap, Hash } from 'lucide-vue-next' +import { User } from 'lucide-vue-next' import { FormControl, FormDescription, @@ -184,27 +131,13 @@ import { FormMessage, } from '@/components/ui/form' import ImageUpload from './ImageUpload.vue' -import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, -} from '@/components/ui/alert-dialog' -import { LogOut } from 'lucide-vue-next' import { useAuth } from '@/composables/useAuthService' -import { useRouter } from 'vue-router' import { injectService, SERVICE_TOKENS } from '@/core/di-container' import type { ImageUploadService } from '../services/ImageUploadService' import { useToast } from '@/core/composables/useToast' // Services -const { user, updateProfile, logout } = useAuth() -const router = useRouter() +const { user, updateProfile } = useAuth() const imageService = injectService(SERVICE_TOKENS.IMAGE_UPLOAD_SERVICE) const toast = useToast() @@ -224,14 +157,14 @@ const lightningDomain = computed(() => import.meta.env.VITE_LIGHTNING_DOMAIN || window.location.hostname ) -// Computed previews +// Live preview of the user's NIP-05 / Lightning address — shown in the +// username field's helper text so the consequence of a future rename is +// visible inline. const nip05Preview = computed(() => { const username = form.values.username || currentUsername.value || 'username' return `${username}@${lightningDomain.value}` }) -const lightningAddress = computed(() => nip05Preview.value) - // Form schema const profileFormSchema = toTypedSchema(z.object({ username: z.string() @@ -327,17 +260,4 @@ const updateUserProfile = async (formData: any) => { isUpdating.value = false } } - -// Log out + redirect to /login on this app's origin. -const onLogout = async () => { - try { - await logout() - toast.success('Logged out') - router.push('/login') - } catch (error) { - const errorMessage = error instanceof Error ? error.message : 'Failed to log out' - console.error('Error logging out:', error) - toast.error(`Logout failed: ${errorMessage}`) - } -}