1
1
import { useQuery , useQueryClient } from "@tanstack/react-query" ;
2
- import { useMatch } from "@tanstack/react-router" ;
3
2
import { writeText } from "@tauri-apps/plugin-clipboard-manager" ;
4
- import { ClipboardCopyIcon , EarIcon , FileAudioIcon , Loader2Icon } from "lucide-react" ;
3
+ import { CheckIcon , ClipboardCopyIcon , EarIcon , FileAudioIcon , PencilIcon } from "lucide-react" ;
5
4
import { useEffect , useRef } from "react" ;
6
5
6
+ import { commands as dbCommands } from "@hypr/plugin-db" ;
7
7
import { commands as miscCommands } from "@hypr/plugin-misc" ;
8
8
import { commands as windowsCommands , events as windowsEvents } from "@hypr/plugin-windows" ;
9
9
import { Button } from "@hypr/ui/components/ui/button" ;
10
10
import { Tooltip , TooltipContent , TooltipProvider , TooltipTrigger } from "@hypr/ui/components/ui/tooltip" ;
11
11
import { useOngoingSession , useSessions } from "@hypr/utils/contexts" ;
12
- import { CheckIcon , PencilIcon } from "lucide-react" ;
13
12
import { useTranscript } from "../hooks/useTranscript" ;
14
13
import { useTranscriptWidget } from "../hooks/useTranscriptWidget" ;
15
14
16
15
export function TranscriptView ( ) {
17
- const noteMatch = useMatch ( { from : "/app/note/$id" , shouldThrow : false } ) ;
18
16
const queryClient = useQueryClient ( ) ;
19
17
const transcriptContainerRef = useRef < HTMLDivElement > ( null ) ;
20
18
21
- if ( ! noteMatch ) {
22
- return (
23
- < div className = "flex items-center justify-center h-full" >
24
- < div className = "text-sm text-neutral-500" >
25
- Widgets are only available in note view.
26
- </ div >
27
- </ div >
28
- ) ;
29
- }
30
-
31
19
const sessionId = useSessions ( ( s ) => s . currentSessionId ) ;
32
20
const isInactive = useOngoingSession ( ( s ) => s . status === "inactive" ) ;
33
21
const { showEmptyMessage, isEnhanced, hasTranscript } = useTranscriptWidget ( sessionId ) ;
@@ -40,6 +28,11 @@ export function TranscriptView() {
40
28
}
41
29
} ;
42
30
31
+ const isOnboarding = useQuery ( {
32
+ queryKey : [ "onboarding" ] ,
33
+ queryFn : ( ) => dbCommands . onboardingSessionId ( ) . then ( ( v ) => v === sessionId ) ,
34
+ } ) ;
35
+
43
36
const audioExist = useQuery (
44
37
{
45
38
refetchInterval : 2500 ,
@@ -141,7 +134,7 @@ export function TranscriptView() {
141
134
</ Tooltip >
142
135
</ TooltipProvider >
143
136
) }
144
- { ! isLive && (
137
+ { ! isLive && ! isOnboarding . data && (
145
138
< Button variant = "ghost" size = "icon" className = "p-0" onClick = { handleClickToggleEditing } >
146
139
{ editing . data
147
140
? < CheckIcon size = { 16 } className = "text-black" />
0 commit comments