fix: suppress unused variable errors after hiding persona/extension UI
vue-tsc flagged variables as unused since their template references are inside HTML comments. Prefix with underscores and comment out the related functions/imports so the production build passes cleanly. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -293,7 +293,8 @@ import { ref, computed, watch, nextTick, onMounted, onUnmounted } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { useAuth } from '../composables/useAuth'
|
||||
import { useAccounts } from '../composables/useAccounts'
|
||||
import { accountManager } from '../lib/accounts'
|
||||
// Hidden in production — re-enable with persona/extension login
|
||||
// import { accountManager } from '../lib/accounts'
|
||||
import { useContentDiscovery } from '../composables/useContentDiscovery'
|
||||
import { useContentSourceStore } from '../stores/contentSource'
|
||||
import { useContentStore } from '../stores/content'
|
||||
@@ -301,7 +302,7 @@ import { indeeHubFilms } from '../data/indeeHubFilms'
|
||||
import { topDocFilms } from '../data/topDocFilms'
|
||||
import type { Content } from '../types/content'
|
||||
|
||||
type Persona = { name: string; nsec: string; pubkey: string }
|
||||
// type Persona = { name: string; nsec: string; pubkey: string }
|
||||
|
||||
interface Props {
|
||||
showNav?: boolean
|
||||
@@ -325,15 +326,16 @@ const emit = defineEmits<Emits>()
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const { user, isAuthenticated, isFilmmaker: isFilmmakerComputed, loginWithNostr: appLoginWithNostr, logout: appLogout } = useAuth()
|
||||
const { user, isAuthenticated, isFilmmaker: isFilmmakerComputed, loginWithNostr: _appLoginWithNostr, logout: appLogout } = useAuth()
|
||||
const {
|
||||
isLoggedIn: nostrLoggedIn,
|
||||
activePubkey: nostrActivePubkey,
|
||||
activeName: nostrActiveName,
|
||||
testPersonas,
|
||||
tastemakerPersonas,
|
||||
loginWithExtension,
|
||||
loginWithPersona,
|
||||
// Hidden in production for now (see template comment)
|
||||
testPersonas: _testPersonas,
|
||||
tastemakerPersonas: _tastemakerPersonas,
|
||||
loginWithExtension: _loginWithExtension,
|
||||
loginWithPersona: _loginWithPersona,
|
||||
logout: nostrLogout,
|
||||
} = useAccounts()
|
||||
|
||||
@@ -547,44 +549,39 @@ function toggleDropdown() {
|
||||
algosMenuOpen.value = false
|
||||
}
|
||||
|
||||
function togglePersonaMenu() {
|
||||
personaMenuOpen.value = !personaMenuOpen.value
|
||||
dropdownOpen.value = false
|
||||
algosMenuOpen.value = false
|
||||
}
|
||||
// Hidden in production for now — uncomment to re-enable persona/extension login
|
||||
// function togglePersonaMenu() {
|
||||
// personaMenuOpen.value = !personaMenuOpen.value
|
||||
// dropdownOpen.value = false
|
||||
// algosMenuOpen.value = false
|
||||
// }
|
||||
|
||||
function navigateTo(path: string) {
|
||||
dropdownOpen.value = false
|
||||
router.push(path)
|
||||
}
|
||||
|
||||
async function handlePersonaLogin(persona: Persona) {
|
||||
personaMenuOpen.value = false
|
||||
// Set up Nostr account (for commenting/reactions)
|
||||
await loginWithPersona(persona)
|
||||
// Also populate auth store (for subscription/My List access)
|
||||
try {
|
||||
await appLoginWithNostr(persona.pubkey, 'persona', {})
|
||||
} catch (err) {
|
||||
// Backend auth failed — persona still works for commenting/reactions
|
||||
// via accountManager, just won't have full API access
|
||||
console.warn('[PersonaLogin] Backend auth failed:', (err as Error).message)
|
||||
}
|
||||
}
|
||||
// async function handlePersonaLogin(persona: Persona) {
|
||||
// personaMenuOpen.value = false
|
||||
// await _loginWithPersona(persona)
|
||||
// try {
|
||||
// await appLoginWithNostr(persona.pubkey, 'persona', {})
|
||||
// } catch (err) {
|
||||
// console.warn('[PersonaLogin] Backend auth failed:', (err as Error).message)
|
||||
// }
|
||||
// }
|
||||
|
||||
async function handleExtensionLogin() {
|
||||
// Set up Nostr account (for commenting/reactions)
|
||||
await loginWithExtension()
|
||||
// Also populate auth store (for subscription/My List access)
|
||||
try {
|
||||
const pubkey = accountManager.active?.pubkey
|
||||
if (pubkey) {
|
||||
await appLoginWithNostr(pubkey, 'extension', {})
|
||||
}
|
||||
} catch {
|
||||
// Auth store mock login — non-critical if it fails
|
||||
}
|
||||
}
|
||||
// async function handleExtensionLogin() {
|
||||
// await _loginWithExtension()
|
||||
// try {
|
||||
// const pubkey = accountManager.active?.pubkey
|
||||
// if (pubkey) {
|
||||
// await appLoginWithNostr(pubkey, 'extension', {})
|
||||
// }
|
||||
// } catch {
|
||||
// // non-critical
|
||||
// }
|
||||
// }
|
||||
|
||||
async function handleLogout() {
|
||||
nostrLogout()
|
||||
|
||||
Reference in New Issue
Block a user