Skip to content

Commit 510fce7

Browse files
committed
chore: fix typecheck
1 parent cbbf2c8 commit 510fce7

File tree

7 files changed

+71
-51
lines changed

7 files changed

+71
-51
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
},
3333
"devDependencies": {
3434
"@octokit/types": "^15.0.0",
35+
"@types/node": "^24.7.0",
3536
"@vitejs/plugin-vue": "^6.0.1",
3637
"drizzle-kit": "^0.31.5",
3738
"eslint": "^9.37.0",

pnpm-lock.yaml

Lines changed: 58 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/prose/PreStream.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<script setup lang="ts">
2+
import { computed } from 'vue'
3+
import { useColorMode } from '@vueuse/core'
4+
import { useHighlighter } from '../../composables/useHighlighter'
25
import { ShikiCachedRenderer } from 'shiki-stream/vue'
36
47
const colorMode = useColorMode()
@@ -38,7 +41,7 @@ const key = computed(() => {
3841
:highlighter="highlighter"
3942
:code="trimmedCode"
4043
:lang="lang"
41-
:theme="colorMode.value === 'dark' ? 'material-theme-palenight' : 'material-theme-lighter'"
44+
:theme="colorMode === 'dark' ? 'material-theme-palenight' : 'material-theme-lighter'"
4245
/>
4346
</ProsePre>
4447
</template>

src/composables/useChats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const useChats = createSharedComposable(() => {
1414
const chats = ref<Chat[]>([])
1515

1616
const fetchChats = async () => {
17-
chats.value = await $fetch('/api/chats').then(data => data.map((chat: never) => ({
17+
chats.value = await $fetch('/api/chats').then(data => data.map((chat: any) => ({
1818
id: chat.id,
1919
label: chat.title || 'Untitled',
2020
to: `/chat/${chat.id}`,

src/composables/useUserSession.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createSharedComposable } from '@vueuse/core'
22
import { ref, computed } from 'vue'
3-
import type { UserSession } from '../../utils/session'
3+
import type { UserSession } from '../../server/utils/session'
44
import { $fetch } from 'ofetch'
55

66
export const useUserSession = createSharedComposable(() => {
@@ -19,7 +19,7 @@ export const useUserSession = createSharedComposable(() => {
1919

2020
const popupListener = (e: StorageEvent) => {
2121
if (e.key === 'temp-auth-popup') {
22-
fetch()
22+
fetchSession()
2323
window.removeEventListener('storage', popupListener)
2424
}
2525
}

src/layouts/default.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<script setup lang="ts">
22
import { ref, computed, watch } from 'vue'
3-
import { useRouter, useRoute } from 'vue-router'
3+
import { useRouter, useRoute, type RouteLocationNormalizedLoaded } from 'vue-router'
44
import { $fetch } from 'ofetch'
55
import ModalConfirm from '../components/ModalConfirm.vue'
66
import { useChats } from '../composables/useChats'
77
import { useUserSession } from '../composables/useUserSession'
88
99
const router = useRouter()
10-
const route = useRoute()
10+
const route = useRoute<'/chat/[id]' | '/'>()
1111
const toast = useToast()
1212
const overlay = useOverlay()
1313
const { loggedIn, openInPopup, fetchSession } = useUserSession()
@@ -60,7 +60,7 @@ async function deleteChat(id: string) {
6060
6161
fetchChats()
6262
63-
if (route.params.id === id) {
63+
if ((route as RouteLocationNormalizedLoaded<'/chat/[id]'>).params?.id === id) {
6464
router.push('/')
6565
}
6666
}

0 commit comments

Comments
 (0)