Skip to content

Commit

Permalink
fix: use static slide info in build mode (#1460)
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Mar 22, 2024
1 parent dc9afe8 commit b8ded9f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/client/composables/useSlideInfo.ts
Expand Up @@ -3,16 +3,17 @@ import { useFetch } from '@vueuse/core'
import type { Ref } from 'vue'
import { computed, ref, unref } from 'vue'
import type { SlideInfo, SlidePatch } from '@slidev/types'
import { getSlide } from '../logic/slides'

export interface UseSlideInfo {
info: Ref<SlideInfo | undefined>
update: (data: SlidePatch) => Promise<SlideInfo | void>
}

export function useSlideInfo(no: number): UseSlideInfo {
if (no == null) {
if (!__SLIDEV_HAS_SERVER__) {
return {
info: ref() as Ref<SlideInfo | undefined>,
info: ref(getSlide(no)?.meta.slide) as Ref<SlideInfo | undefined>,
update: async () => {},
}
}
Expand Down

0 comments on commit b8ded9f

Please sign in to comment.