useLightboxModeService.ts
582 Bytes
import { LightboxModeWebsocketService } from '@/core/websocket/processor'
import type { DrawApp } from '@/fitCore/types'
import { useContentDataStoreWithOut } from '@/store/modules/contentData'
import { isLightboxMode, isShareMode } from '@/utils/env'
export function useLightboxModeService(App: DrawApp) {
if (isShareMode() || isLightboxMode()) {
const contentDataStore = useContentDataStoreWithOut()
// eslint-disable-next-line no-new
new LightboxModeWebsocketService(App, contentDataStore.contentData)
}
}
window.useLightboxModeService = useLightboxModeService