fix build errors

This commit is contained in:
padreug 2025-09-17 02:29:15 +02:00
parent 8c39ca3599
commit 2a9915a727
7 changed files with 18 additions and 20 deletions

View file

@ -10,7 +10,7 @@ import { useReactions } from '../composables/useReactions'
import appConfig from '@/app.config' import appConfig from '@/app.config'
import type { ContentFilter } from '../services/FeedService' import type { ContentFilter } from '../services/FeedService'
import MarketProduct from './MarketProduct.vue' import MarketProduct from './MarketProduct.vue'
import { parseMarketProduct, isMarketEvent, getMarketEventType } from '../utils/marketParser' import { parseMarketProduct } from '../utils/marketParser'
interface Emits { interface Emits {
(e: 'reply-to-note', note: { id: string; content: string; pubkey: string }): void (e: 'reply-to-note', note: { id: string; content: string; pubkey: string }): void
@ -140,7 +140,8 @@ function getMarketProductData(note: any) {
content: note.content, content: note.content,
created_at: note.created_at, created_at: note.created_at,
kind: note.kind, kind: note.kind,
tags: note.tags tags: note.tags,
sig: '' // Required by Event interface
} }
return parseMarketProduct(mockEvent) return parseMarketProduct(mockEvent)
} }
@ -313,11 +314,11 @@ async function onToggleLike(note: any) {
Reply Reply
</Badge> </Badge>
<Badge <Badge
v-if="isMarketEvent({ kind: note.kind })" v-if="note.kind === 30018"
variant="outline" variant="outline"
class="text-xs px-1.5 py-0.5" class="text-xs px-1.5 py-0.5"
> >
{{ getMarketEventType({ kind: note.kind }) }} Market Product
</Badge> </Badge>
<Badge <Badge
v-if="isRidesharePost(note)" v-if="isRidesharePost(note)"

View file

@ -164,8 +164,8 @@ const props = defineProps<Props>()
const emit = defineEmits<Emits>() const emit = defineEmits<Emits>()
// Services // Services
const relayHub = injectService(SERVICE_TOKENS.RELAY_HUB) const relayHub = injectService(SERVICE_TOKENS.RELAY_HUB) as any
const authService = injectService(SERVICE_TOKENS.AUTH_SERVICE) const authService = injectService(SERVICE_TOKENS.AUTH_SERVICE) as any
const toast = useToast() const toast = useToast()
// Form state // Form state
@ -193,7 +193,7 @@ const form = useForm({
const { values, meta, resetForm, setFieldValue } = form const { values, meta, resetForm, setFieldValue } = form
// Computed properties // Computed properties
const isFormValid = computed(() => meta.value.valid && values.content.trim().length > 0) const isFormValid = computed(() => meta.value.valid && (values.content?.trim().length || 0) > 0)
const characterCount = computed(() => values.content?.length || 0) const characterCount = computed(() => values.content?.length || 0)
// Watch mentions array and sync with form // Watch mentions array and sync with form
@ -294,7 +294,7 @@ const onSubmit = form.handleSubmit(async (values) => {
// Create note event template // Create note event template
const eventTemplate: EventTemplate = { const eventTemplate: EventTemplate = {
kind: 1, kind: 1,
content: values.content.trim(), content: values.content?.trim() || '',
tags, tags,
created_at: Math.floor(Date.now() / 1000) created_at: Math.floor(Date.now() / 1000)
} }

View file

@ -223,7 +223,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watch } from 'vue' import { ref, computed } from 'vue'
import { useForm } from 'vee-validate' import { useForm } from 'vee-validate'
import { toTypedSchema } from '@vee-validate/zod' import { toTypedSchema } from '@vee-validate/zod'
import * as z from 'zod' import * as z from 'zod'
@ -254,8 +254,8 @@ interface Emits {
const emit = defineEmits<Emits>() const emit = defineEmits<Emits>()
// Services // Services
const authService = injectService(SERVICE_TOKENS.AUTH_SERVICE) const authService = injectService(SERVICE_TOKENS.AUTH_SERVICE) as any
const relayHub = injectService(SERVICE_TOKENS.RELAY_HUB) const relayHub = injectService(SERVICE_TOKENS.RELAY_HUB) as any
const toast = useToast() const toast = useToast()
// Form schema // Form schema
@ -280,7 +280,7 @@ const rideshareSchema = toTypedSchema(z.object({
const form = useForm({ const form = useForm({
validationSchema: rideshareSchema, validationSchema: rideshareSchema,
initialValues: { initialValues: {
type: '', type: undefined as 'offering' | 'seeking' | undefined,
fromLocation: '', fromLocation: '',
toLocation: '', toLocation: '',
date: '', date: '',
@ -292,7 +292,7 @@ const form = useForm({
} }
}) })
const { values, meta, setFieldValue, resetForm } = form const { values, meta, resetForm } = form
const isFormValid = computed(() => meta.value.valid) const isFormValid = computed(() => meta.value.valid)
// State // State

View file

@ -1,4 +1,4 @@
import { ref, computed, watch, onMounted } from 'vue' import { ref, computed } from 'vue'
import { injectService, SERVICE_TOKENS } from '@/core/di-container' import { injectService, SERVICE_TOKENS } from '@/core/di-container'
import type { ProfileService } from '../services/ProfileService' import type { ProfileService } from '../services/ProfileService'

View file

@ -1,4 +1,4 @@
import { ref, reactive } from 'vue' import { reactive } from 'vue'
import { BaseService } from '@/core/base/BaseService' import { BaseService } from '@/core/base/BaseService'
import { injectService, SERVICE_TOKENS } from '@/core/di-container' import { injectService, SERVICE_TOKENS } from '@/core/di-container'
import type { Event as NostrEvent, Filter } from 'nostr-tools' import type { Event as NostrEvent, Filter } from 'nostr-tools'
@ -24,7 +24,6 @@ export class ProfileService extends BaseService {
// Profile cache - reactive for UI updates // Profile cache - reactive for UI updates
private _profiles = reactive(new Map<string, UserProfile>()) private _profiles = reactive(new Map<string, UserProfile>())
private _isLoading = ref(false)
private currentSubscription: string | null = null private currentSubscription: string | null = null
private currentUnsubscribe: (() => void) | null = null private currentUnsubscribe: (() => void) | null = null

View file

@ -42,7 +42,6 @@ export class ReactionService extends BaseService {
private currentUnsubscribe: (() => void) | null = null private currentUnsubscribe: (() => void) | null = null
// Track deletion subscription separately // Track deletion subscription separately
private deletionSubscription: string | null = null
private deletionUnsubscribe: (() => void) | null = null private deletionUnsubscribe: (() => void) | null = null
// Track which events we're monitoring // Track which events we're monitoring
@ -99,7 +98,7 @@ export class ReactionService extends BaseService {
} }
}) })
this.deletionSubscription = subscriptionId // Store subscription ID if needed for tracking
this.deletionUnsubscribe = unsubscribe this.deletionUnsubscribe = unsubscribe
} catch (error) { } catch (error) {

View file

@ -134,7 +134,6 @@
// TODO: Re-enable when push notifications are properly implemented // TODO: Re-enable when push notifications are properly implemented
// import NotificationPermission from '@/components/notifications/NotificationPermission.vue' // import NotificationPermission from '@/components/notifications/NotificationPermission.vue'
import { ref, computed, watch } from 'vue' import { ref, computed, watch } from 'vue'
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
import { Filter, Plus, MessageSquare, Car } from 'lucide-vue-next' import { Filter, Plus, MessageSquare, Car } from 'lucide-vue-next'
import PWAInstallPrompt from '@/components/pwa/PWAInstallPrompt.vue' import PWAInstallPrompt from '@/components/pwa/PWAInstallPrompt.vue'
import FeedFilters from '@/modules/nostr-feed/components/FeedFilters.vue' import FeedFilters from '@/modules/nostr-feed/components/FeedFilters.vue'
@ -187,7 +186,7 @@ const feedType = computed(() => {
if (selectedFilters.value.length === 0) return 'all' if (selectedFilters.value.length === 0) return 'all'
// Check if it matches a preset // Check if it matches a preset
for (const [presetName, presetFilters] of Object.entries(FILTER_PRESETS)) { for (const [, presetFilters] of Object.entries(FILTER_PRESETS)) {
if (presetFilters.length === selectedFilters.value.length && if (presetFilters.length === selectedFilters.value.length &&
presetFilters.every(pf => selectedFilters.value.some(sf => sf.id === pf.id))) { presetFilters.every(pf => selectedFilters.value.some(sf => sf.id === pf.id))) {
return 'custom' // Always use custom for proper filtering return 'custom' // Always use custom for proper filtering