File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,20 @@ import styled from 'styled-components';
2
2
import OBSIcon from '@assets/img_studio_obs.png' ;
3
3
import DownloadIcon from '@assets/download.svg' ;
4
4
import { getOrCreateId } from '@utils/id' ;
5
+ import useFetchStreamKey from '@queries/host/useFetchStreamKey' ;
6
+ import { useEffect } from 'react' ;
5
7
6
8
interface SettingInfoProps {
7
9
closeModal : ( ) => void ;
8
10
}
9
11
10
12
export default function SettingInfo ( { closeModal } : SettingInfoProps ) {
11
13
const userId = getOrCreateId ( ) ;
14
+ const { mutate : fetchKey , data } = useFetchStreamKey ( ) ;
15
+
16
+ useEffect ( ( ) => {
17
+ fetchKey ( userId ) ;
18
+ } , [ ] ) ;
12
19
13
20
return (
14
21
< PopupOverlay onClick = { closeModal } >
@@ -57,8 +64,10 @@ export default function SettingInfo({ closeModal }: SettingInfoProps) {
57
64
< SettingRow >
58
65
< Label htmlFor = "stream-key" > 스트림 키</ Label >
59
66
< ValueWithButton >
60
- < StreamKeyInput type = "password" readOnly value = "djjrx3ufdxqbrv1apr9lo5y9ly07nuyp" />
61
- < CopyButton onClick = { ( ) => navigator . clipboard . writeText ( 'djjrx3ufdxqbrv1apr9lo5y9ly07nuyp' ) } >
67
+ < StreamKeyInput type = "password" readOnly value = { data ?. [ 'stream-key' ] ?? '' } />
68
+ < CopyButton
69
+ onClick = { ( ) => data ?. [ 'stream-key' ] && navigator . clipboard . writeText ( data [ 'stream-key' ] ) }
70
+ >
62
71
복사
63
72
</ CopyButton >
64
73
</ ValueWithButton >
Original file line number Diff line number Diff line change 18
18
"@assets/*" : [" src/assets/*" ],
19
19
"@styles/*" : [" src/styles/*" ],
20
20
"@type/*" : [" src/type/*" ],
21
- "@apis/*" : [" src/apis/*" ]
21
+ "@apis/*" : [" src/apis/*" ],
22
+ "@queries/*" : [" src/queries/*" ]
22
23
},
23
24
"types" : [" vite/client" ]
24
25
},
You can’t perform that action at this time.
0 commit comments