fix build errors
This commit is contained in:
parent
8c39ca3599
commit
2a9915a727
7 changed files with 18 additions and 20 deletions
|
|
@ -10,7 +10,7 @@ import { useReactions } from '../composables/useReactions'
|
|||
import appConfig from '@/app.config'
|
||||
import type { ContentFilter } from '../services/FeedService'
|
||||
import MarketProduct from './MarketProduct.vue'
|
||||
import { parseMarketProduct, isMarketEvent, getMarketEventType } from '../utils/marketParser'
|
||||
import { parseMarketProduct } from '../utils/marketParser'
|
||||
|
||||
interface Emits {
|
||||
(e: 'reply-to-note', note: { id: string; content: string; pubkey: string }): void
|
||||
|
|
@ -140,7 +140,8 @@ function getMarketProductData(note: any) {
|
|||
content: note.content,
|
||||
created_at: note.created_at,
|
||||
kind: note.kind,
|
||||
tags: note.tags
|
||||
tags: note.tags,
|
||||
sig: '' // Required by Event interface
|
||||
}
|
||||
return parseMarketProduct(mockEvent)
|
||||
}
|
||||
|
|
@ -313,11 +314,11 @@ async function onToggleLike(note: any) {
|
|||
Reply
|
||||
</Badge>
|
||||
<Badge
|
||||
v-if="isMarketEvent({ kind: note.kind })"
|
||||
v-if="note.kind === 30018"
|
||||
variant="outline"
|
||||
class="text-xs px-1.5 py-0.5"
|
||||
>
|
||||
{{ getMarketEventType({ kind: note.kind }) }}
|
||||
Market Product
|
||||
</Badge>
|
||||
<Badge
|
||||
v-if="isRidesharePost(note)"
|
||||
|
|
|
|||
|
|
@ -164,8 +164,8 @@ const props = defineProps<Props>()
|
|||
const emit = defineEmits<Emits>()
|
||||
|
||||
// Services
|
||||
const relayHub = injectService(SERVICE_TOKENS.RELAY_HUB)
|
||||
const authService = injectService(SERVICE_TOKENS.AUTH_SERVICE)
|
||||
const relayHub = injectService(SERVICE_TOKENS.RELAY_HUB) as any
|
||||
const authService = injectService(SERVICE_TOKENS.AUTH_SERVICE) as any
|
||||
const toast = useToast()
|
||||
|
||||
// Form state
|
||||
|
|
@ -193,7 +193,7 @@ const form = useForm({
|
|||
const { values, meta, resetForm, setFieldValue } = form
|
||||
|
||||
// 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)
|
||||
|
||||
// Watch mentions array and sync with form
|
||||
|
|
@ -294,7 +294,7 @@ const onSubmit = form.handleSubmit(async (values) => {
|
|||
// Create note event template
|
||||
const eventTemplate: EventTemplate = {
|
||||
kind: 1,
|
||||
content: values.content.trim(),
|
||||
content: values.content?.trim() || '',
|
||||
tags,
|
||||
created_at: Math.floor(Date.now() / 1000)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { useForm } from 'vee-validate'
|
||||
import { toTypedSchema } from '@vee-validate/zod'
|
||||
import * as z from 'zod'
|
||||
|
|
@ -254,8 +254,8 @@ interface Emits {
|
|||
const emit = defineEmits<Emits>()
|
||||
|
||||
// Services
|
||||
const authService = injectService(SERVICE_TOKENS.AUTH_SERVICE)
|
||||
const relayHub = injectService(SERVICE_TOKENS.RELAY_HUB)
|
||||
const authService = injectService(SERVICE_TOKENS.AUTH_SERVICE) as any
|
||||
const relayHub = injectService(SERVICE_TOKENS.RELAY_HUB) as any
|
||||
const toast = useToast()
|
||||
|
||||
// Form schema
|
||||
|
|
@ -280,7 +280,7 @@ const rideshareSchema = toTypedSchema(z.object({
|
|||
const form = useForm({
|
||||
validationSchema: rideshareSchema,
|
||||
initialValues: {
|
||||
type: '',
|
||||
type: undefined as 'offering' | 'seeking' | undefined,
|
||||
fromLocation: '',
|
||||
toLocation: '',
|
||||
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)
|
||||
|
||||
// State
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue