diff --git a/www/app/[domain]/layout.tsx b/www/app/[domain]/layout.tsx index 73cc4841..84cb639e 100644 --- a/www/app/[domain]/layout.tsx +++ b/www/app/[domain]/layout.tsx @@ -1,6 +1,6 @@ import "../styles/globals.scss"; import { Poppins } from "next/font/google"; -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import FiefWrapper from "../(auth)/fiefWrapper"; import UserInfo from "../(auth)/userInfo"; import { ErrorProvider } from "../(errors)/errorContext"; @@ -17,7 +17,15 @@ import { SESSION_COOKIE_NAME } from "../lib/fief"; const poppins = Poppins({ subsets: ["latin"], weight: ["200", "400", "600"] }); +export const viewport: Viewport = { + themeColor: 'black', + width: "device-width", + initialScale: 1, + maximumScale: 1, +} + export const metadata: Metadata = { + metadataBase: process.env.DEV_URL || "https://reflector.media", title: { template: "%s – Reflector", default: "Reflector - AI-Powered Meeting Transcriptions by Monadical", @@ -54,12 +62,6 @@ export const metadata: Metadata = { shortcut: "/r-icon.png", apple: "/r-icon.png", }, - viewport: { - width: "device-width", - initialScale: 1, - maximumScale: 1, - }, - robots: { index: false, follow: false, noarchive: true, noimageindex: true }, }; diff --git a/www/app/[domain]/transcripts/useWebSockets.ts b/www/app/[domain]/transcripts/useWebSockets.ts index a2bccf37..bb05137a 100644 --- a/www/app/[domain]/transcripts/useWebSockets.ts +++ b/www/app/[domain]/transcripts/useWebSockets.ts @@ -3,6 +3,7 @@ import { Topic, FinalSummary, Status } from "./webSocketTypes"; import { useError } from "../../(errors)/errorContext"; import { DomainContext } from "../domainContext"; import { AudioWaveform, GetTranscriptSegmentTopic } from "../../api"; +import useApi from "../../lib/useApi"; export type UseWebSockets = { transcriptText: string; @@ -32,6 +33,7 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => { const { setError } = useError(); const { websocket_url } = useContext(DomainContext); + const api = useApi(); useEffect(() => { if (isProcessing || textQueue.length === 0) { @@ -306,7 +308,10 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => { } }; - if (!transcriptId) return; + if (!transcriptId || !api) return; + + api?.v1TranscriptGetWebsocketEvents(transcriptId).then((result) => { + }); const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`; let ws = new WebSocket(url); @@ -412,7 +417,9 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => { console.debug("WebSocket connection closed"); switch (event.code) { case 1000: // Normal Closure: + break; case 1005: // Closure by client FF + break; default: setError( new Error(`WebSocket closed unexpectedly with code: ${event.code}`), @@ -431,7 +438,7 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => { return () => { ws.close(); }; - }, [transcriptId]); + }, [transcriptId, !api]); return { transcriptText,